public class LabyrinthGelem extends Gelem
This gelem draws an appropriate labyrinth cell taking into consideration the contents of the eight adjacent cells.
+++
+X+
+++
This class follows DbC(tm) methodology. Where possible, contracts are implement with JML and native's Java assert.
Modifier and Type | Field and Description |
---|---|
static int |
ROAD |
static int |
ROAD_E |
static int |
ROAD_N |
static int |
ROAD_NE |
static int |
ROAD_NW |
static int |
ROAD_S |
static int |
ROAD_SE |
static int |
ROAD_SW |
static int |
ROAD_W |
Constructor and Description |
---|
LabyrinthGelem(int form) |
LabyrinthGelem(int form,
int numberOfLines,
int numberOfColumns) |
Modifier and Type | Method and Description |
---|---|
boolean |
isRoad() |
boolean |
isWall() |
static void |
resetShowRoadBoundaries()
Singleton method to reset the visualization of road boundaries (this is the default).
|
static void |
setGapPercentageSize(double perc)
Singleton method to define the separation gap between a wall and a road.
|
static void |
setShowRoadBoundaries()
Singleton method to set the visualization of road boundaries (as a thin yellow square).
|
static boolean |
validForm(int form) |
className, draw, erase, height, intersects, isMutable, mutable, mutableDraw, mutableErase, numberOfColumns, numberOfLines, width, x, y
public static final int ROAD_NW
public static final int ROAD_N
public static final int ROAD_NE
public static final int ROAD_W
public static final int ROAD_E
public static final int ROAD_SW
public static final int ROAD_S
public static final int ROAD_SE
public static final int ROAD
public LabyrinthGelem(int form)
public LabyrinthGelem(int form, int numberOfLines, int numberOfColumns)
public static void setGapPercentageSize(double perc)
requires: perc >= 0.0 && perc <= 100.0
perc
- percentage valuepublic static void setShowRoadBoundaries()
public static void resetShowRoadBoundaries()
public static boolean validForm(int form)
public boolean isWall()
public boolean isRoad()