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