org.newdawn.slick.util.pathfinding
Interface AStarHeuristic

All Known Implementing Classes:
ClosestHeuristic, ClosestSquaredHeuristic, ManhattanHeuristic

public interface AStarHeuristic

The description of a class providing a cost for a given tile based on a target location and entity being moved. This heuristic controls what priority is placed on different tiles during the search for a path

Author:
Kevin Glass

Method Summary
 float getCost(TileBasedMap map, Mover mover, int x, int y, int tx, int ty)
          Get the additional heuristic cost of the given tile.
 

Method Detail

getCost

float getCost(TileBasedMap map,
              Mover mover,
              int x,
              int y,
              int tx,
              int ty)
Get the additional heuristic cost of the given tile. This controls the order in which tiles are searched while attempting to find a path to the target location. The lower the cost the more likely the tile will be searched.

Parameters:
map - The map on which the path is being found
mover - The entity that is moving along the path
x - The x coordinate of the tile being evaluated
y - The y coordinate of the tile being evaluated
tx - The x coordinate of the target location
ty - Teh y coordinate of the target location
Returns:
The cost associated with the given tile


Copyright © 2006 New Dawn Software. All Rights Reserved.