maze.structure
Class MazeCellWall

java.lang.Object
  extended byjava.util.Observable
      extended bymaze.structure.MazeCell
          extended bymaze.structure.MazeCellWall

public class MazeCellWall
extends MazeCell

A Cell which is used and has walls. This is the Cell used to fill the Maze.


Field Summary
 
Fields inherited from class maze.structure.MazeCell
BLACK, BLANK, RED, special, theColor, theLocation
 
Constructor Summary
MazeCellWall(MazeGeometry g)
          Constructs a new MazeCellWall with the given Geometry.
MazeCellWall(MazeGeometry g, int d1)
          Constructs a new MazeCellWall with the given Geometry and Wall direction.
MazeCellWall(MazeGeometry g, int d1, int d2)
          Constructs a new MazeCellWall with the given Geometry and wall directions.
MazeCellWall(MazeGeometry g, int d1, int d2, int d3)
          Constructs a new MazeCellWall with the given Geometry and wall directions.
 
Method Summary
 void clearWall(int d)
          Clears a wall in the given direction.
 void drawFloor(java.awt.Graphics g)
          Draws the floor of a walled cell.
 void drawWall(java.awt.Graphics g)
          Draws the walls of a walled cell.
 void setWall(int d)
          Sets a wall in the given direction.
 java.lang.String toString()
          Returns a String description of this cell.
 boolean used()
          Returns true if this cell is used.
 boolean wallTo(int d)
          Returns true if there is a wall in the given direction.
 
Methods inherited from class maze.structure.MazeCell
getColor, setColor, setCoord, setGeoCoord, setGeometry, special
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MazeCellWall

public MazeCellWall(MazeGeometry g)
Constructs a new MazeCellWall with the given Geometry.

Parameters:
g - MazeGeometry for this Cell.

MazeCellWall

public MazeCellWall(MazeGeometry g,
                    int d1)
Constructs a new MazeCellWall with the given Geometry and Wall direction.

Parameters:
g - MazeGeometry for this Cell.
d1 - int direction to place a wall.

MazeCellWall

public MazeCellWall(MazeGeometry g,
                    int d1,
                    int d2)
Constructs a new MazeCellWall with the given Geometry and wall directions.

Parameters:
g - MazeGeometry for this Cell.
d1 - int direction to place a wall.
d2 - int direction to place a wall.

MazeCellWall

public MazeCellWall(MazeGeometry g,
                    int d1,
                    int d2,
                    int d3)
Constructs a new MazeCellWall with the given Geometry and wall directions.

Parameters:
g - MazeGeometry for this Cell.
d1 - int direction to place a wall.
d2 - int direction to place a wall.
d3 - int direction to place a wall.
Method Detail

setWall

public void setWall(int d)
Sets a wall in the given direction.

Parameters:
d - int direction to place a wall.

clearWall

public void clearWall(int d)
Clears a wall in the given direction.

Parameters:
d - int direction to clear a wall.

wallTo

public boolean wallTo(int d)
Returns true if there is a wall in the given direction.

Parameters:
d - int direction to test for a wall.
Returns:
True if a wall has been set in the given direction.

drawFloor

public void drawFloor(java.awt.Graphics g)
Draws the floor of a walled cell.

Specified by:
drawFloor in class MazeCell
Parameters:
g - Graphics context.

drawWall

public void drawWall(java.awt.Graphics g)
Draws the walls of a walled cell.

Specified by:
drawWall in class MazeCell
Parameters:
g - Graphics context.

toString

public java.lang.String toString()
Returns a String description of this cell.

Specified by:
toString in class MazeCell
Returns:
String description of this cell.

used

public boolean used()
Returns true if this cell is used.

Specified by:
used in class MazeCell
Returns:
True; an empty cell is not used.