Amazing Mazes

Interface MazeAdapter

All Known Implementing Classes:
MazeGenAdapter

public interface MazeAdapter

The MazeAdapter interface provides a neutral and abstract mechnism to access various maze objects ... a gateway so-to-speak. A Mouse object which traverses it's maze via the MazeAdapter interface is insulated from the physical maze object, thereby allowing the same Mouse to traverse any number of mazes :-)

Version:
1.0 09/05/2000
Author:
Kevin Bridges ... Copyright (c) 2001

Method Summary
 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.
 

Method Detail

getStartingCoord

public java.awt.Point getStartingCoord()
This method will return the starting coordinate of self's maze (i.e. the cell from which we will start from).
Returns:
the starting coordinate of self's maze.

getEndingCoord

public java.awt.Point getEndingCoord()
This method will return the ending coordinate of self's maze (i.e. the goal cell to traverse too).
Returns:
the ending coordinate of self's maze.

passagewayOpenAt

public 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.
Parameters:
cellLocation - the maze cell coordinate that is to be checked.
direction - the direction within the cellLocation that is to be checked.
Returns:
true if the passageway (within self's maze) at the supplied cellLocation/direction is open, otherwise return false.

visualizeAdvance

public 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. An advancement move (depending on the maze) can be visualized differently than a retreat move ... say by a different color. If this is done, then the animation will picture dead-end moves more distinctly.
Parameters:
cellLocation - the maze cell coordinate that is the start of the advancment.
direction - the direction within the cellLocation that we are to move.

visualizeRetreat

public 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. An retreat move (depending on the maze) can be visualized differently than an advancment move ... say by a different color. If this is done, then the animation will picture dead-end moves more distinctly.
Parameters:
cellLocation - the maze cell coordinate that is the start of the retreat.
direction - the direction within the cellLocation that we are to move.

erectWall

public 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.

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.

Parameters:
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.

Author: Andrew Bridges
Copyright © 2001