|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The model for a maze. Known implementations: Maze
Field Summary | |
static byte |
MARK
Bitmap value for an "I've been here" mark. |
static byte |
WALLS
Bitmap value for all walls (no passages). |
static byte |
XMI
Bitmap value for an exit in the X- direction. |
static byte |
XPL
Bitmap value for an exit in the X+ direction. |
static byte |
YMI
Bitmap value for an exit in the Y- direction. |
static byte |
YPL
Bitmap value for an exit in the Y+ direction. |
static byte |
ZMI
Bitmap value for an exit in the Z- direction. |
static byte |
ZPL
Bitmap value for an exit in the Z+ direction. |
Method Summary | |
void |
addMazeListener(MazeListener l)
Add a MazeListener. |
Coordinate3D |
getCurrent()
Get the current player co-ordinate. |
Coordinate3D |
getFinish()
Get the finish cell location. |
Coordinate3D |
getSize()
Get the size of the maze. |
byte |
grid(Coordinate3D c)
Get the contents of a cell. |
byte |
grid(int x,
int y,
int z)
Get the contents of a cell. |
boolean |
isMarked(Coordinate3D position)
Check if the given cell has an "I've been here" marker. |
boolean |
isOpen(Coordinate3D current,
byte direction)
Check and see if movement is possible. |
void |
removeMazeListener(MazeListener l)
Remove a MazeListener. |
void |
setCurrent(Coordinate3D current)
Set the current player co-ordinate. |
void |
setFinish(Coordinate3D finish)
Set the position of the finish or goal cell. |
void |
setMark(Coordinate3D position,
boolean mark)
Set an "I've been here" mark in the given cell. |
void |
setRandomFinish()
Set a random position for the finish cell. |
Stack |
solve(Coordinate3D start)
Solve the maze from a given start position. |
Field Detail |
public static final byte WALLS
public static final byte XPL
public static final byte XMI
public static final byte YPL
public static final byte YMI
public static final byte ZPL
public static final byte ZMI
public static final byte MARK
Method Detail |
public Coordinate3D getSize()
public void setMark(Coordinate3D position, boolean mark)
position
- The 3D co-ordinate of the cell.mark
- True to set a mark, false to remove it.public byte grid(int x, int y, int z)
x
- The x co-ordinate.y
- The y co-ordinate.z
- The z co-ordinate.public byte grid(Coordinate3D c)
c
- The 3D co-ordinate of the cell.public void setFinish(Coordinate3D finish)
finish
- The 3D co-ordinate of the cell.public void setRandomFinish()
public Coordinate3D getFinish()
public void setCurrent(Coordinate3D current)
current
- The 3D co-ordinate of the player in the maze.public Coordinate3D getCurrent()
public boolean isMarked(Coordinate3D position)
position
- The 3D co-ordinate of the cell to check.public boolean isOpen(Coordinate3D current, byte direction)
current
- The 3D co-ordinate to start from.direction
- The direction to go, one of XPL,XMI etc.public Stack solve(Coordinate3D start)
start
- The 3D co-ordinate to start from.public void addMazeListener(MazeListener l)
l
- A MazeListener to listen for maze changes.public void removeMazeListener(MazeListener l)
l
- The MazeListener to remove.
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |