public abstract class AbstractPathMap<TileType extends AbstractPathTile> extends AbstractTileMap<TileType> implements PathBasedMap<TileType>
collisions, fact, heightInTile, screenHeight, theme, tileHeight, tileWidth, widthInTile
DIR
Constructor and Description |
---|
AbstractPathMap(int tileWidth,
int tileHeight,
AbstractWorld world) |
Modifier and Type | Method and Description |
---|---|
boolean |
blocked(PathMover mover,
int v,
int h)
Check if current location is blocking or not.
|
void |
create(int widthInTile,
int heightInTile)
Create and prepare map memory area.
|
float |
getCost(PathMover mover,
int sx,
int sy,
int tx,
int ty)
Get the cost of the complete path, from start till end.
|
int |
getRef(int v,
int h) |
TileType |
getTileArroundUntil(int v,
int h,
int width,
int height)
Search the first unblocking tile arround location (clock way).
|
abstract void |
loadXML(XMLNode root)
Load a map from a specified file as xml.
|
void |
pathFinderVisited(int v,
int h)
Mark the tile as visited.
|
protected void |
renderTile(java.awt.Graphics2D g,
TileType tile,
int startX,
int startY)
Render a specific tile from specified location (different to the other renderTile, as it is called in render function).
|
void |
setRef(int v,
int h,
int id) |
createTile, getCollision, getHeightInTiles, getPattern, getPatterns, getPatternsNumber, getTheme, getTile, getTileHeight, getTilesNumber, getTileWidth, getWidthInTiles, load, loadPatterns, readCollisions, render, render, render, renderTile, save, saveXML, setTile
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getHeightInTiles, getPatternsNumber, getTile, getTileHeight, getTileWidth, getWidthInTiles, renderTile
public AbstractPathMap(int tileWidth, int tileHeight, AbstractWorld world)
public final void create(int widthInTile, int heightInTile)
AbstractTileMap
create
in class AbstractTileMap<TileType extends AbstractPathTile>
widthInTile
- map width in tile.heightInTile
- map height in tile.protected void renderTile(java.awt.Graphics2D g, TileType tile, int startX, int startY)
AbstractTileMap
renderTile
in class AbstractTileMap<TileType extends AbstractPathTile>
g
- graphic output.tile
- tile to render.startX
- location x.startY
- location y.public void pathFinderVisited(int v, int h)
PathBasedMap
pathFinderVisited
in interface PathBasedMap<TileType extends AbstractPathTile>
v
- vertical location.h
- horizontal location.public TileType getTileArroundUntil(int v, int h, int width, int height)
PathBasedMap
getTileArroundUntil
in interface PathBasedMap<TileType extends AbstractPathTile>
v
- vertical location.h
- horizontal location.width
- number of horizontal tiles to search.height
- number of vertical tiles to search.public boolean blocked(PathMover mover, int v, int h)
PathBasedMap
blocked
in interface PathBasedMap<TileType extends AbstractPathTile>
mover
- object moving on map.v
- vertical location.h
- horizontal location.public float getCost(PathMover mover, int sx, int sy, int tx, int ty)
PathBasedMap
getCost
in interface PathBasedMap<TileType extends AbstractPathTile>
mover
- object moving on map.sx
- starting location x.sy
- starting location y.tx
- ending location x.ty
- ending location y.public void setRef(int v, int h, int id)
setRef
in interface PathBasedMap<TileType extends AbstractPathTile>
public int getRef(int v, int h)
getRef
in interface PathBasedMap<TileType extends AbstractPathTile>
public abstract void loadXML(XMLNode root)
AbstractTileMap
loadXML
in class AbstractTileMap<TileType extends AbstractPathTile>
root
- input node.