Partial 7.0 merge - API preview
This commit is contained in:
@@ -26,8 +26,8 @@ public class Teams{
|
||||
public Seq<TeamData> active = new Seq<>();
|
||||
/** Teams with block or unit presence. */
|
||||
public Seq<TeamData> present = new Seq<>(TeamData.class);
|
||||
/** Current boss unit. */
|
||||
public @Nullable Unit boss;
|
||||
/** Current boss units. */
|
||||
public Seq<Unit> bosses = new Seq<>();
|
||||
|
||||
public Teams(){
|
||||
active.add(get(Team.crux));
|
||||
@@ -117,7 +117,6 @@ public class Teams{
|
||||
if(data.active() && !active.contains(data)){
|
||||
active.add(data);
|
||||
updateEnemies();
|
||||
indexer.updateTeamIndex(data.team);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -145,7 +144,7 @@ public class Teams{
|
||||
|
||||
public void updateTeamStats(){
|
||||
present.clear();
|
||||
boss = null;
|
||||
bosses.clear();
|
||||
|
||||
for(Team team : Team.all){
|
||||
TeamData data = team.data();
|
||||
@@ -172,16 +171,17 @@ public class Teams{
|
||||
}
|
||||
|
||||
//update presence flag.
|
||||
Groups.build.each( b -> b.team.data().presentFlag = true);
|
||||
Groups.build.each(b -> b.team.data().presentFlag = true);
|
||||
|
||||
for(Unit unit : Groups.unit){
|
||||
if(unit.type == null) continue;
|
||||
TeamData data = unit.team.data();
|
||||
data.tree().insert(unit);
|
||||
data.units.add(unit);
|
||||
data.presentFlag = true;
|
||||
|
||||
if(unit.team == state.rules.waveTeam && unit.isBoss()){
|
||||
boss = unit;
|
||||
bosses.add(unit);
|
||||
}
|
||||
|
||||
if(data.unitsByType == null || data.unitsByType.length <= unit.type.id){
|
||||
@@ -241,12 +241,17 @@ public class Teams{
|
||||
/** Target items to mine. */
|
||||
public Seq<Item> mineItems = Seq.with(Items.copper, Items.lead, Items.titanium, Items.thorium);
|
||||
|
||||
/** Quadtree for all buildings of this team. Null if not active. */
|
||||
@Nullable
|
||||
public QuadTree<Building> buildings;
|
||||
/** Current unit cap. Do not modify externally. */
|
||||
public int unitCap;
|
||||
/** Total unit count. */
|
||||
public int unitCount;
|
||||
/** Counts for each type of unit. Do not access directly. */
|
||||
@Nullable
|
||||
public int[] typeCounts;
|
||||
/** Quadtree for units of this type. Do not access directly. */
|
||||
/** Quadtree for units of this team. Do not access directly. */
|
||||
@Nullable
|
||||
public QuadTree<Unit> tree;
|
||||
/** Units of this team. Updated each frame. */
|
||||
@@ -328,5 +333,16 @@ public class Teams{
|
||||
this.block = block;
|
||||
this.config = config;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString(){
|
||||
return "BlockPlan{" +
|
||||
"x=" + x +
|
||||
", y=" + y +
|
||||
", rotation=" + rotation +
|
||||
", block=" + block +
|
||||
", config=" + config +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user