Constructor and Description |
---|
MapDataImpl(int tileWidth,
int tileHeight,
java.util.List<TilePosition> startingLocations) |
Modifier and Type | Method and Description |
---|---|
Position |
crop(Position position)
Returns a cropped version of the specified position if it is not inside the map.
|
TilePosition |
crop(TilePosition tilePosition)
Returns a cropped version of the specified position if it is not inside the map.
|
WalkPosition |
crop(WalkPosition walkPosition)
Returns a cropped version of the specified position if it is not inside the map.
|
Position |
getCenter()
Returns the center of the map in pixels.
|
Position |
getPixelSize()
Returns the size of the map in pixels.
|
Position |
getRandomPosition()
Returns a random position on the map in pixels.
|
java.util.List<TilePosition> |
getStartingLocations()
Returns the internal container of the starting Locations.
Note: these correspond to BWAPI::getStartLocations(). |
TilePosition |
getTileSize()
Returns the size of the map in tiles.
|
WalkPosition |
getWalkSize()
Returns the size of the map in walktiles.
|
boolean |
isValid(Position position)
Tests whether the specified position is inside the map.
|
boolean |
isValid(TilePosition tilePosition)
Tests whether the specified position is inside the map.
|
boolean |
isValid(WalkPosition walkPosition)
Tests whether the specified position is inside the map.
|
public MapDataImpl(int tileWidth, int tileHeight, java.util.List<TilePosition> startingLocations)
public TilePosition getTileSize()
MapData
getTileSize
in interface MapData
public WalkPosition getWalkSize()
MapData
getWalkSize
in interface MapData
public Position getPixelSize()
MapData
getPixelSize
in interface MapData
public Position getCenter()
MapData
public java.util.List<TilePosition> getStartingLocations()
MapData
getStartingLocations
in interface MapData
public boolean isValid(TilePosition tilePosition)
MapData
public boolean isValid(WalkPosition walkPosition)
MapData
public boolean isValid(Position position)
MapData
public TilePosition crop(TilePosition tilePosition)
MapData
public WalkPosition crop(WalkPosition walkPosition)
MapData
public Position crop(Position position)
MapData
public Position getRandomPosition()
MapData
getRandomPosition
in interface MapData