Package mindustry.ai
Class BlockIndexer
java.lang.Object
mindustry.ai.BlockIndexer
Class used for indexing special target blocks for AI.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
allBuildings
(float x, float y, float range, arc.func.Cons<mindustry.gen.Building> cons) boolean
eachBlock
(Team team, float wx, float wy, float range, arc.func.Boolf<mindustry.gen.Building> pred, arc.func.Cons<mindustry.gen.Building> cons) 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.boolean
eachBlock
(mindustry.gen.Teamc team, float range, arc.func.Boolf<mindustry.gen.Building> pred, arc.func.Cons<mindustry.gen.Building> cons) mindustry.gen.Building
findClosestFlag
(float x, float y, Team team, BlockFlag flag) findClosestOre
(float xp, float yp, Item item) Find the closest ore block relative to a position.findClosestOre
(mindustry.gen.Unit unit, Item item) Find the closest ore block relative to a position.findClosestWallOre
(float xp, float yp, Item item) Find the closest ore wall relative to a position.findClosestWallOre
(mindustry.gen.Unit unit, Item item) Find the closest ore block relative to a position.mindustry.gen.Building
findEnemyTile
(Team team, float x, float y, float range, arc.func.Boolf<mindustry.gen.Building> pred) mindustry.gen.Building
findEnemyTile
(Team team, float x, float y, float range, Units.BuildingPriorityf priority, arc.func.Boolf<mindustry.gen.Building> pred) mindustry.gen.Building
mindustry.gen.Building
findTile
(Team team, float x, float y, float range, arc.func.Boolf<mindustry.gen.Building> pred, boolean usePriority) arc.struct.Seq<Item>
arc.struct.Seq<mindustry.gen.Building>
getDamaged
(Team team) Returns all damaged tiles by team.arc.struct.Seq<mindustry.gen.Building>
Get all enemy blocks with a flag.arc.struct.Seq<mindustry.gen.Building>
getFlagged
(Team team, BlockFlag type) Get all allied blocks with a flag.arc.struct.Seq<Tile>
getFlaggedFloors
(BlockFlag flag) boolean
boolean
hasWallOre
(Item item) boolean
isBlockPresent
(Block block) void
notifyHealthChanged
(mindustry.gen.Building build) void
removeIndex
(Tile tile)
-
Constructor Details
-
BlockIndexer
public BlockIndexer()
-
-
Method Details
-
getAllPresentOres
-
getFlaggedFloors
-
removeIndex
-
addIndex
-
isBlockPresent
- Returns:
- whether a certain block is anywhere on this map.
-
hasOre
- Returns:
- whether this item is present on this map.
-
hasWallOre
- Returns:
- whether this item is present on this map as a wall ore.
-
getDamaged
Returns all damaged tiles by team. -
getFlagged
Get all allied blocks with a flag. -
findClosestFlag
-
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
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
Find the closest ore block relative to a position. -
findClosestWallOre
Find the closest ore wall relative to a position. -
findClosestOre
Find the closest ore block relative to a position. -
findClosestWallOre
Find the closest ore block relative to a position.
-