Fetch instruction

This commit is contained in:
Anuken
2022-04-10 12:14:22 -04:00
parent a7c898a08f
commit 84686a260d
8 changed files with 112 additions and 5 deletions

View File

@@ -150,6 +150,7 @@ public class Teams{
data.presentFlag = false;
data.unitCount = 0;
data.units.clear();
data.players.clear();
if(data.tree != null){
data.tree.clear();
}
@@ -195,6 +196,10 @@ public class Teams{
count(unit);
}
for(var player : Groups.player){
player.team().data().players.add(player);
}
//update presence of each team.
for(Team team : Team.all){
TeamData data = team.data();
@@ -251,6 +256,8 @@ public class Teams{
public @Nullable QuadTree<Unit> tree;
/** Units of this team. Updated each frame. */
public Seq<Unit> units = new Seq<>();
/** Same as units, but players. */
public Seq<Player> players = new Seq<>();
/** Units of this team by type. Updated each frame. */
public @Nullable Seq<Unit>[] unitsByType;