New WIP achievement definitions

This commit is contained in:
Anuken
2022-10-09 17:47:12 -04:00
parent dfdb4c1c1f
commit 4201106843
20 changed files with 419 additions and 26 deletions

View File

@@ -286,6 +286,11 @@ public class Teams{
return buildingTypes.get(block, () -> new Seq<>(false));
}
public int getCount(Block block){
var res = buildingTypes.get(block);
return res == null ? 0 : res.size;
}
/** Destroys this team's presence on the map, killing part of its buildings and converting everything to 'derelict'. */
public void destroyToDerelict(){
@@ -355,6 +360,12 @@ public class Teams{
}
}
//this is just an alias for consistency
@Nullable
public Seq<Unit> getUnits(UnitType type){
return unitCache(type);
}
@Nullable
public Seq<Unit> unitCache(UnitType type){
if(unitsByType == null || unitsByType.length <= type.id || unitsByType[type.id] == null) return null;