Amazing Mazes

Class Position

java.lang.Object
  |
  +--Position

public class Position
extends java.lang.Object

The Position class is used to retain location information for a specified cell within a maze. A Position object represents both the mazes cell location, as well as directional information (i.e. what direction we entered this cell).

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

Field Summary
private  java.awt.Point cellLocation_
          Maze cell location (coordinates) represented by this Position.
private  Direction enteredDir_
          The direction from which we entered this cell position (from the perspective of the previous cell).
 
Constructor Summary
Position(java.awt.Point cellLocation, Direction enteredDir)
          Construct a Position instance with the specified parameters.
 
Method Summary
 java.awt.Point getCellLocation()
          Get the cell location (maze coordinates) represented by this Position.
 Direction getEnteredDir()
          Get the direction from which we entered this cell position (from the perspective of the previous cell).
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

cellLocation_

private java.awt.Point cellLocation_
Maze cell location (coordinates) represented by this Position.

enteredDir_

private Direction enteredDir_
The direction from which we entered this cell position (from the perspective of the previous cell).
Constructor Detail

Position

public Position(java.awt.Point cellLocation,
                Direction enteredDir)
Construct a Position instance with the specified parameters.

 Logic Flow:
   1. Retain selected parameters in self.
   Processing End (Position)
 
Parameters:
cellLocation - the maze cell location (coordinates) represented by this Position.
enteredDir - the direction from which we enetered this cell position (from the perspective of the previous cell).
Method Detail

getCellLocation

public java.awt.Point getCellLocation()
Get the cell location (maze coordinates) represented by this Position.
Returns:
the cell location (maze coordinates) represented by this Position.

getEnteredDir

public Direction getEnteredDir()
Get the direction from which we entered this cell position (from the perspective of the previous cell).
Returns:
the direction from which we entered this cell position (from the perspective of the previous cell).

Author: Andrew Bridges
Copyright © 2001