Constructor and Description |
---|
MiniTileImpl() |
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 Map::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, Map::getNearestArea should be prefered over Map::getArea. |
boolean |
isAltitudeMissing() |
boolean |
isAreaIdMissing() |
boolean |
isBlocked() |
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 |
isSeaOrLake() |
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. |
void |
replaceAreaId(AreaId areaId) |
void |
replaceBlockedAreaId(AreaId areaId) |
void |
setAltitude(Altitude altitude) |
void |
setAreaId(AreaId areaId) |
void |
setBlocked() |
void |
setLake() |
void |
setSea() |
void |
setWalkable(boolean walkable) |
public boolean isWalkable()
MiniTile
Tile.isBuildable()
)isWalkable
in interface MiniTile
public Altitude getAltitude()
MiniTile
getAltitude
in interface MiniTile
public boolean isSea()
MiniTile
public boolean isLake()
MiniTile
public boolean isTerrain()
MiniTile
public AreaId getAreaId()
MiniTile
public void setWalkable(boolean walkable)
public boolean isSeaOrLake()
public void setSea()
public void setLake()
public boolean isAltitudeMissing()
public void setAltitude(Altitude altitude)
public boolean isAreaIdMissing()
public void setAreaId(AreaId areaId)
public void replaceAreaId(AreaId areaId)
public void setBlocked()
public boolean isBlocked()
public void replaceBlockedAreaId(AreaId areaId)