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

    • 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.
    • getDamaged

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

      public 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, Boolf<mindustry.gen.Building> pred, Cons<mindustry.gen.Building> cons)
    • eachBlock

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

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

      public 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, Cons<mindustry.gen.Building> cons)
    • findEnemyTile

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

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

      public mindustry.gen.Building findTile(Team team, float x, float y, float range, 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.
    • findClosestOre

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