be.saltwater.jaqel.creature
Class PathFinder

java.lang.Object
  extended bybe.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

Field Summary
static int FREE_TILE_COST
           
static int MONSTER_TILE_COST
           
 
Constructor Summary
PathFinder(Level level)
           
 
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
 

Field Detail

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
Constructor Detail

PathFinder

public PathFinder(Level level)
Method Detail

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.