public final class MiniTile extends Object
TerrainData.getMiniTile(WalkPosition)
Modifier and Type | Field and Description |
---|---|
static Comparator<Pair<?,MiniTile>> |
BY_ALTITUDE_ORDER |
Modifier and Type | Method and Description |
---|---|
Altitude |
getAltitude()
Distance in pixels between the center of this MiniTile and the center of the nearest
Sea-MiniTile
- Sea-miniTiles all have their Altitude() equal to 0. - miniTiles having Altitude() > 0 are not Sea-miniTiles. |
AreaId |
getAreaId()
For Sea and Lake miniTiles, returns 0
For Terrain miniTiles, returns a non zero id: - if (id > 0), id uniquely identifies the Area A that contains this MiniTile. Moreover we have: A.id() == id and BWMap::getArea(id) == A - For more information about positive Area::ids, see Area::id() - if (id < 0), then this MiniTile is part of a Terrain-zone that was considered too small to create an Area for it. - Note: negative Area::ids start from -2 - Note: because of the lakes, BWMap::getNearestArea should be prefered over BWMap::getArea. |
boolean |
isLake()
Lake-miniTiles are unwalkable miniTiles that have their Altitude() > 0.
- They form small zones (inside Terrain-zones) that can be eaysily walked around (e.g. |
boolean |
isSea()
Sea-miniTiles are unwalkable miniTiles that have their altitude equal to 0.
|
boolean |
isTerrain()
Terrain miniTiles are just walkable miniTiles
|
boolean |
isWalkable()
Corresponds approximatively to BWAPI::isWalkable
The differences are: - For each BWAPI's unwalkable MiniTile, we also mark its 8 neighbors as not walkable. According to some tests, this prevents from wrongly pretending one small unit can go by some thin path. - The relation buildable ==> walkable is enforced, by marking as walkable any MiniTile part of a buildable Tile (Cf. |
public static final Comparator<Pair<?,MiniTile>> BY_ALTITUDE_ORDER
public boolean isWalkable()
Tile.isBuildable()
)public Altitude getAltitude()
public boolean isSea()
public boolean isLake()
public boolean isTerrain()
public AreaId getAreaId()
Copyright © 2022. All rights reserved.