|
Amazing Mazes | ||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--MazeGenAdapter
The MazeGenAdapter class provides a neutral access mechnism to the MazeGen Maze object ... a gateway so-to-speak.
Because MazeGenAdapter implements the MazeAdapter interface, maze access is insulated from the physical maze object, allowing any number of mazes to be plugged into the project.
MazeGen
Field Summary | |
private static int[] |
dirXlator_
This array provides a translation between the "neutral" Direction indicator and MazeGen's standard directional bit masks. |
private Maze |
maze_
The MazeGen Maze which we are wrapping. |
private static int[] |
wallXlator_
This array provides a translation between the "neutral" Direction indicator and MazeGen's directional wall bit masks. |
Constructor Summary | |
MazeGenAdapter(Maze maze)
Construct a MazeGenAdapter instance that wraps the supplied MazeGen Maze object. |
Method Summary | |
(package private) static void |
|
(package private) static void |
|
static int |
dirXlator(Direction direction)
This static method will tranlslate a "neutral" Direction indicator to MazeGen's standard directional bit mask (i.e. |
void |
erectWall(java.awt.Point cellLocation,
Direction direction)
This method will erect a wall in self's maze, at the supplied cellLocation, facing the supplied direction. |
java.awt.Point |
getEndingCoord()
This method will return the ending coordinate of self's maze (i.e. |
java.awt.Point |
getStartingCoord()
This method will return the starting coordinate of self's maze (i.e. |
boolean |
passagewayOpenAt(java.awt.Point cellLocation,
Direction direction)
This method will return a true/false indicator as to whether the passageway (within self's maze) at the supplied cellLocation/direction is open or not. |
void |
visualizeAdvance(java.awt.Point cellLocation,
Direction direction)
This method will visualize an advancement move within self's maze at the supplied cellLocation and direction. |
void |
visualizeRetreat(java.awt.Point cellLocation,
Direction direction)
This method will visualize a retreat move within self's maze at the supplied cellLocation and direction. |
static int |
wallXlator(Direction direction)
This static method will tranlslate a "neutral" Direction indicator to MazeGen's directional wall bit mask (i.e. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
registerNatives,
toString,
wait,
wait,
wait |
Field Detail |
private Maze maze_
private static final int[] dirXlator_
private static final int[] wallXlator_
Constructor Detail |
public MazeGenAdapter(Maze maze)
maze
- the MazeGen Maze which we are wrapping.Method Detail |
public java.awt.Point getStartingCoord()
public java.awt.Point getEndingCoord()
public boolean passagewayOpenAt(java.awt.Point cellLocation, Direction direction)
cellLocation
- the maze cell coordinate that is to be checked.direction
- the direction within the cellLocation that is to be checked.public void visualizeAdvance(java.awt.Point cellLocation, Direction direction)
cellLocation
- the maze cell coordinate that is the start of
the advancment.direction
- the direction within the cellLocation that we
are to move.public void visualizeRetreat(java.awt.Point cellLocation, Direction direction)
cellLocation
- the maze cell coordinate that is the start of
the retreat.direction
- the direction within the cellLocation that we
are to move.public void erectWall(java.awt.Point cellLocation, Direction direction)
The context in which this is used is to NOT visualize a physical wall within the maze, but rather to close the wall that has been traversed ... in order to prevent advancment back where we came from.
Logic Flow: 1. No-op if supplied direction is not one of the four directional indicators. 2. Logically-Or the wall bitmask to erect the wall in the specified direction. Processing End (erectWall)
cellLocation
- the maze cell coordinate where the wall is to
be erected.direction
- the direction within the cellLocation where the
wall is to be erected.public static int dirXlator(Direction direction)
direction
- the neutral direction to translate.public static int wallXlator(Direction direction)
direction
- the neutral direction to translate.static void()
static void()
|
Author: Andrew Bridges Copyright © 2001 |
||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |