maze.filler
Class PathEnd

java.lang.Object
  extended bymaze.filler.PathEnd

public class PathEnd
extends java.lang.Object

A Bean that represents the end cell of a path being generated. These are pushed into PushPop storage structures to track the various branches of the path through the maze as the path is being constructed.


Field Summary
protected  Coordinate theCoordinate
          The Coordinate for the end of the path.
protected  int theDirection
          The direction of the end of the path.
protected  MazeGeometry theGeometry
          Contains the MazeGeometry required to interpret this PathEnd.
 
Constructor Summary
PathEnd(MazeGeometry g, Coordinate c, int d)
          Creates a new PathEnd from a Coordinate and a direction.
 
Method Summary
 Coordinate coord()
          Returns the Coordinate for the end of the path.
 int dir()
          Returns the current direction.
 Coordinate getCoordinate()
          Gets the coordinate of the path end cell.
 int getDirection()
          Gets the direction this path end is facing.
 void setCoordinate(Coordinate c)
          Sets the coordinate for this path end cell.
 void setDirection(int d)
          Sets the direction this path end is facing.
 void setGeometry(MazeGeometry g)
          Sets the underlying Maze Geometry for this PathEnd.
 java.lang.String toString()
          Returns a String representation for the end of the path.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

theCoordinate

protected Coordinate theCoordinate
The Coordinate for the end of the path. This identifies the last cell.


theDirection

protected int theDirection
The direction of the end of the path. This identifies the intended exit from the cell.


theGeometry

protected MazeGeometry theGeometry
Contains the MazeGeometry required to interpret this PathEnd.

Constructor Detail

PathEnd

public PathEnd(MazeGeometry g,
               Coordinate c,
               int d)
Creates a new PathEnd from a Coordinate and a direction.

Parameters:
c - Coordinate location of the cell at the end of a path.
d - int direction in which the path is being generated.
Method Detail

dir

public int dir()
Returns the current direction.

Returns:
int current direction for the path.

coord

public Coordinate coord()
Returns the Coordinate for the end of the path.

Returns:
Coordinate location of the cell at the end of the path.

toString

public java.lang.String toString()
Returns a String representation for the end of the path.

Returns:
String representation for the end of the path.

setCoordinate

public void setCoordinate(Coordinate c)
Sets the coordinate for this path end cell.

Parameters:
c - Coordinate of the path end.

getCoordinate

public Coordinate getCoordinate()
Gets the coordinate of the path end cell.

Returns:
Coordinate of the path end.

setDirection

public void setDirection(int d)
Sets the direction this path end is facing.

Parameters:
d - int direction for this path end.

getDirection

public int getDirection()
Gets the direction this path end is facing.

Returns:
int path end direction.

setGeometry

public void setGeometry(MazeGeometry g)
Sets the underlying Maze Geometry for this PathEnd.

Parameters:
g - MazeGeometry instance