|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectmaze.filler.MazeFiller
A strategy for filling a maze's cells with walls. Subclasses have different approaches to dealing with edges, collisions, turns, etc.
| Field Summary | |
protected double |
branch
The branching factor (between 0.0 and 1.0). |
protected PushPop |
theOpenEnds
The PushPop used when filling the Maze. |
protected java.util.Random |
theRNG
A Random Number Generator used when filling the Maze. |
| Constructor Summary | |
MazeFiller()
Constructs a new MazeFiller. |
|
MazeFiller(PushPop p)
Constructs a new MazeFiller with the given PushPop; either a Stack or a Queue. |
|
MazeFiller(PushPop p,
double b)
Constructs a new MazeFiller with the given PushPop (either a Stack or a Queue) and a given branching factor between 0.0 and 1.0. |
|
| Method Summary | |
protected void |
branch(Maze m,
Coordinate c,
int d)
Places a random branch in the path. |
void |
finish(Maze m)
Finishes the maze filling process. |
boolean |
next(Maze m)
Fills the next cell. |
void |
start(Maze m)
Starts filling the maze with Cells. |
protected void |
straight(Maze m,
Coordinate c,
int d)
Places a wall because this PathEnd crossed another path. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected PushPop theOpenEnds
protected java.util.Random theRNG
protected double branch
| Constructor Detail |
public MazeFiller()
public MazeFiller(PushPop p)
p - PushPop to use, either Stack or Queue.
public MazeFiller(PushPop p,
double b)
p - PushPop to use, either Stack or Queue.b - double branching factor between 0.0 and 1.0.| Method Detail |
public void start(Maze m)
m - The Maze to fill.public boolean next(Maze m)
m - PathEnd where we found the collision.
public void finish(Maze m)
m - The Maze to fill.
protected void straight(Maze m,
Coordinate c,
int d)
m - The Maze to fill.c - Coordinate for the Cell.d - int direction for the straight-through path.
protected void branch(Maze m,
Coordinate c,
int d)
m - The Maze to fill.c - Coordinate for the Cell.d - int direction for the straight-through path.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||