mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-07-28 21:57:51 +07:00
Dynamic pathfinding
This commit is contained in:
@ -9,8 +9,8 @@ import java.util.*;
|
||||
|
||||
/** Creates quadtrees per unit team. */
|
||||
public class TeamIndexProcess implements AsyncProcess{
|
||||
private QuadTree<Unitc>[] trees = new QuadTree[Team.all().length];
|
||||
private int[] counts = new int[Team.all().length];
|
||||
private QuadTree<Unitc>[] trees = new QuadTree[Team.all.length];
|
||||
private int[] counts = new int[Team.all.length];
|
||||
|
||||
public QuadTree<Unitc> tree(Team team){
|
||||
if(trees[team.uid] == null) trees[team.uid] = new QuadTree<>(Vars.world.getQuadBounds(new Rect()));
|
||||
@ -28,14 +28,14 @@ public class TeamIndexProcess implements AsyncProcess{
|
||||
|
||||
@Override
|
||||
public void reset(){
|
||||
counts = new int[Team.all().length];
|
||||
trees = new QuadTree[Team.all().length];
|
||||
counts = new int[Team.all.length];
|
||||
trees = new QuadTree[Team.all.length];
|
||||
}
|
||||
|
||||
@Override
|
||||
public void begin(){
|
||||
|
||||
for(Team team : Team.all()){
|
||||
for(Team team : Team.all){
|
||||
if(trees[team.uid] != null){
|
||||
trees[team.uid].clear();
|
||||
}
|
||||
|
Reference in New Issue
Block a user