rlgamekit.pathfinding
Class Area

java.lang.Object
  extended by rlgamekit.pathfinding.Area

public class Area
extends java.lang.Object

A breadth-first area finder. It will find all locations which are reachable from the given start point, using the given path source.

See Also:
Point

Constructor Summary
Area()
          Creates a new instance of Area with no points.
 
Method Summary
 void clear()
          Reset area, remove all points.
 boolean findArea(PathSource pathSource, int sx, int sy)
          Breadth first area finding.
 java.util.ArrayList<java.awt.Point> getArea()
          Access the list of all points in the found area.
 void setUseDiagonals(boolean yesno)
          Use diagonals in are finding?
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Area

public Area()
Creates a new instance of Area with no points.

Method Detail

setUseDiagonals

public void setUseDiagonals(boolean yesno)
Use diagonals in are finding? Default is true.


getArea

public java.util.ArrayList<java.awt.Point> getArea()
Access the list of all points in the found area.

Returns:
the list of all points in the found area.

clear

public void clear()
Reset area, remove all points.


findArea

public boolean findArea(PathSource pathSource,
                        int sx,
                        int sy)
Breadth first area finding.

Parameters:
pathSource - the pathSource to search
sx - Source x-coordinate
sy - Source y-coordinate
Returns:
true if path was found, false otherwise