Shield breaker block

This commit is contained in:
Anuken
2022-04-21 14:34:01 -04:00
parent bfdf07d0eb
commit 09221f952a
6 changed files with 47 additions and 3 deletions

View File

@@ -10,6 +10,7 @@ import mindustry.*;
import mindustry.ai.*;
import mindustry.gen.*;
import mindustry.type.*;
import mindustry.world.*;
import mindustry.world.blocks.payloads.*;
import mindustry.world.blocks.storage.CoreBlock.*;
@@ -260,6 +261,8 @@ public class Teams{
public int unitCount;
/** Counts for each type of unit. Do not access directly. */
public @Nullable int[] typeCounts;
/** Cached buildings by type. */
public ObjectMap<Block, Seq<Building>> buildingTypes = new ObjectMap<>();
/** Units of this team. Updated each frame. */
public Seq<Unit> units = new Seq<>(false);
/** Same as units, but players. */
@@ -273,6 +276,10 @@ public class Teams{
this.team = team;
}
public Seq<Building> getBuildings(Block block){
return buildingTypes.get(block, () -> new Seq<>(false));
}
/** Destroys this team's presence on the map, killing part of its buildings and converting everything to 'derelict'. */
public void destroyToDerelict(){