zombie.ai.astar
Interface TileBasedMap

All Known Implementing Classes:
IsoCell

public interface TileBasedMap

The description for the data we're pathfinding over. This provides the contract between the data being searched (i.e. the in game map) and the path finding generic tools

Author:
Kevin Glass

Method Summary
 boolean blocked(Mover mover, int x, int y, int z, int lx, int ly, int lz)
          Check if the given location is blocked, i.e.
 float getCost(Mover mover, int sx, int sy, int sz, int tx, int ty, int tz)
          get the cost of moving through the given tile.
 int getElevInTiles()
           
 int getHeightInTiles()
          get the height of the tile map.
 int getWidthInTiles()
          get the width of the tile map.
 boolean isNull(int x, int y, int z)
           
 boolean IsStairsNode(AStarPathMap.Node node, AStarPathMap.Node prev, IsoDirections directions)
           
 void pathFinderVisited(int x, int y, int z)
          Notification that the path finder visited a given tile.
 

Method Detail

blocked

boolean blocked(Mover mover,
                int x,
                int y,
                int z,
                int lx,
                int ly,
                int lz)
Check if the given location is blocked, i.e. blocks movement of the supplied mover.

Parameters:
mover - The mover that is potentially moving through the specified tile.
x - The x coordinate of the tile to check
y - The y coordinate of the tile to check
Returns:
True if the location is blocked

getCost

float getCost(Mover mover,
              int sx,
              int sy,
              int sz,
              int tx,
              int ty,
              int tz)
get the cost of moving through the given tile. This can be used to make certain areas more desirable. A simple and valid implementation of this method would be to return 1 in all cases.

Parameters:
mover - The mover that is trying to move across the tile
sx - The x coordinate of the tile we're moving from
sy - The y coordinate of the tile we're moving from
tx - The x coordinate of the tile we're moving to
ty - The y coordinate of the tile we're moving to
Returns:
The relative cost of moving across the given tile

getElevInTiles

int getElevInTiles()

getHeightInTiles

int getHeightInTiles()
get the height of the tile map. The slightly odd name is used to distiguish this method from commonly used names in game maps.

Returns:
The number of tiles down the map

getWidthInTiles

int getWidthInTiles()
get the width of the tile map. The slightly odd name is used to distiguish this method from commonly used names in game maps.

Returns:
The number of tiles across the map

pathFinderVisited

void pathFinderVisited(int x,
                       int y,
                       int z)
Notification that the path finder visited a given tile. This is used for debugging new heuristics.

Parameters:
x - The x coordinate of the tile that was visited
y - The y coordinate of the tile that was visited

isNull

boolean isNull(int x,
               int y,
               int z)

IsStairsNode

boolean IsStairsNode(AStarPathMap.Node node,
                     AStarPathMap.Node prev,
                     IsoDirections directions)