Package mindustry.ai

Class BlockIndexer

java.lang.Object
mindustry.ai.BlockIndexer

public class BlockIndexer extends Object
Class used for indexing special target blocks for AI.
  • Constructor Details

    • BlockIndexer

      public BlockIndexer()
  • Method Details

    • getAllPresentOres

      public arc.struct.Seq<Item> getAllPresentOres()
    • getFlaggedFloors

      public arc.struct.Seq<Tile> getFlaggedFloors(BlockFlag flag)
    • removeIndex

      public void removeIndex(Tile tile)
    • addIndex

      public void addIndex(Tile tile)
    • isBlockPresent

      public boolean isBlockPresent(Block block)
      Returns:
      whether a certain block is anywhere on this map.
    • hasOre

      public boolean hasOre(Item item)
      Returns:
      whether this item is present on this map.
    • hasWallOre

      public boolean hasWallOre(Item item)
      Returns:
      whether this item is present on this map as a wall ore.
    • getDamaged

      public arc.struct.Seq<mindustry.gen.Building> getDamaged(Team team)
      Returns all damaged tiles by team.
    • getFlagged

      public arc.struct.Seq<mindustry.gen.Building> getFlagged(Team team, BlockFlag type)
      Get all allied blocks with a flag.
    • findClosestFlag

      @Nullable public mindustry.gen.Building findClosestFlag(float x, float y, Team team, BlockFlag flag)
    • eachBlock

      public boolean eachBlock(mindustry.gen.Teamc team, float range, arc.func.Boolf<mindustry.gen.Building> pred, arc.func.Cons<mindustry.gen.Building> cons)
    • eachBlock

      public boolean eachBlock(@Nullable Team team, float wx, float wy, float range, arc.func.Boolf<mindustry.gen.Building> pred, arc.func.Cons<mindustry.gen.Building> cons)
    • eachBlock

      public boolean eachBlock(Team team, arc.math.geom.Rect rect, arc.func.Boolf<mindustry.gen.Building> pred, arc.func.Cons<mindustry.gen.Building> cons)
      Does not work with null teams.
    • getEnemy

      public arc.struct.Seq<mindustry.gen.Building> getEnemy(Team team, BlockFlag type)
      Get all enemy blocks with a flag.
    • notifyHealthChanged

      public void notifyHealthChanged(mindustry.gen.Building build)
    • allBuildings

      public void allBuildings(float x, float y, float range, arc.func.Cons<mindustry.gen.Building> cons)
    • findEnemyTile

      public mindustry.gen.Building findEnemyTile(Team team, float x, float y, float range, Units.BuildingPriorityf priority, arc.func.Boolf<mindustry.gen.Building> pred)
    • findEnemyTile

      public mindustry.gen.Building findEnemyTile(Team team, float x, float y, float range, arc.func.Boolf<mindustry.gen.Building> pred)
    • findTile

      public mindustry.gen.Building findTile(Team team, float x, float y, float range, arc.func.Boolf<mindustry.gen.Building> pred)
    • findTile

      public mindustry.gen.Building findTile(Team team, float x, float y, float range, arc.func.Boolf<mindustry.gen.Building> pred, boolean usePriority)
    • findClosestOre

      public Tile findClosestOre(float xp, float yp, Item item)
      Find the closest ore block relative to a position.
    • findClosestWallOre

      public Tile findClosestWallOre(float xp, float yp, Item item)
      Find the closest ore wall relative to a position.
    • findClosestOre

      public Tile findClosestOre(mindustry.gen.Unit unit, Item item)
      Find the closest ore block relative to a position.
    • findClosestWallOre

      public Tile findClosestWallOre(mindustry.gen.Unit unit, Item item)
      Find the closest ore block relative to a position.