|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectmaze.geometry.MazeGeometry
maze.geometry.RectGeometry
Facts about the current maze geometry. In this case it is a bounded rectangular geometry. Methods are available which will transform a coordinate and a direction into a new coordinate. Directions can be absolute directions or a direction and an angle.
| Field Summary | |
protected static int |
East
Cardinal direction East for this geometry. |
protected static int |
North
Cardinal direction North for this geometry. |
protected static int |
South
Cardinal direction South for this geometry. |
protected static int |
West
Cardinal direction West for this geometry. |
| Fields inherited from class maze.geometry.MazeGeometry |
Debug, hMax, hScale, MAX_DIRECTIONS, origin, P1, P2, vMax, vScale |
| Constructor Summary | |
RectGeometry(int h,
int v)
Creates a new RectGeometry with the given horizontal and vertical extent. |
|
| Method Summary | |
Coordinate |
advance(Coordinate c,
int d)
Compute a new coordinate, given a coordinate and an absolute direction |
protected double |
cellRadius()
Computes the center-to-vertex distance for a cell with this geometry. |
protected Coordinate |
east(Coordinate c)
Computes the coordinates offset to the East. |
static java.lang.String |
label(int d)
Creates a String label for a given direction |
static java.lang.String |
label(int dir,
int angle)
Creates a String label for a direction offset by an angle. |
protected Coordinate |
north(Coordinate c)
Computes the coordinates offset to the North. |
protected Coordinate |
south(Coordinate c)
Computes the coordinates offset to the South. |
int |
startDir()
Finds a good starting pair of directions, must be distinct |
protected Coordinate |
west(Coordinate c)
Computes the coordinates offset to the West. |
| Methods inherited from class maze.geometry.MazeGeometry |
advance, cellHoffset, cellPoly, cellVoffset, iterator, left, opp, right, setRect, setTiling, start, turn, wallP1, wallP2, wallPoly |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected static final int North
protected static final int South
protected static final int East
protected static final int West
| Constructor Detail |
public RectGeometry(int h,
int v)
h - int horizontal size of the geometry.v - int vertical size of the geometry.| Method Detail |
public static java.lang.String label(int d)
d - int direction.
public static java.lang.String label(int dir,
int angle)
dir - int base direction.angle - int angle of offset.
protected Coordinate north(Coordinate c)
c - Coordinates for a cell.
protected Coordinate south(Coordinate c)
c - Coordinates for a cell.
protected Coordinate west(Coordinate c)
c - Coordinates for a cell.
protected Coordinate east(Coordinate c)
c - Coordinates for a cell.
public Coordinate advance(Coordinate c,
int d)
advance in class MazeGeometryc - Coordinate initial location.d - int direction offset from the initial coordinate.
public int startDir()
startDir in class MazeGeometryprotected double cellRadius()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||