be.saltwater.jaqel.creature
Class PathFinder
java.lang.Object
be.saltwater.jaqel.creature.PathFinder
- public class PathFinder
- extends java.lang.Object
An algorithm that finds the shortest path from a starting point to an end point. Used by a Creature object.
- Author:
- Robin Wittevrongel
- See Also:
PathFinderNode,
Creature
|
Method Summary |
java.util.List |
findPath(java.awt.Point start,
java.awt.Point end,
boolean approach)
Starts the algorithm and sets the starting node and end node. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FREE_TILE_COST
public static final int FREE_TILE_COST
- See Also:
- Constant Field Values
MONSTER_TILE_COST
public static final int MONSTER_TILE_COST
- See Also:
- Constant Field Values
PathFinder
public PathFinder(Level level)
findPath
public java.util.List findPath(java.awt.Point start,
java.awt.Point end,
boolean approach)
- Starts the algorithm and sets the starting node and end node.
- Parameters:
start - A Point object that contains the coordinates of the starting node.end - A Point object that contains the coordinates of the end node.
- Returns:
- An list of Point objects with coordinates to follow to move from the starting point to the end point.