|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object wyvern.kernel.dungeon.AbstractLevelGenerator wyvern.kernel.dungeon.CaveGenerator
This file will create a random dungeon of arbitrary size and attributes. It will create tunnels between the various rooms and otherwise emulate a simple "net-hack" style dungeon maker. The symbols used are: # <- The wall around a room. Used only for representation, here. In the final version, players will see all of the empty squares as solid stone as well. + <- A door. If white, a secret door. . <- Open square. Either inside a room, or part of a tunnel. < <- The stairwell up to the previous level. > <- The stairwell down to the next level.
Field Summary | |
static java.lang.String |
DEFAULT_CAVE_FLOOR
|
static int |
DEFAULT_CAVE_HEIGHT
|
static java.lang.String |
DEFAULT_CAVE_WALL
|
static int |
DEFAULT_CAVE_WIDTH
|
static int |
DEFAULT_DENSITY
|
static int |
DEFAULT_HIDDEN_CHANCE
|
static int |
DEFAULT_MIN_ROOMS
|
static int |
DEFAULT_SECRET_CHANCE
|
Fields inherited from class wyvern.kernel.dungeon.AbstractLevelGenerator |
DEFAULT_HEIGHT, DEFAULT_WIDTH, floor_, height_, oobTerrain_, stairsDown_, stairsUp_, terrain_, width_ |
Constructor Summary | |
CaveGenerator()
|
Method Summary | |
GameMap |
generate(java.lang.Class mapclass)
Generates a GameMap. |
void |
generateCaves()
Generates the caverns and connects them. |
int |
getDensity()
|
int |
getMinRooms()
|
int |
getSecretChance()
|
static void |
main(java.lang.String[] argv)
|
void |
setDensity(int density)
Sets the number of attempts it makes to create random new rooms. |
void |
setMinRooms(int rooms)
Sets the minimum number of rooms. |
void |
setSecretChance(int chance)
The odds, 0-100, that a given door is a secret door. |
Methods inherited from class wyvern.kernel.dungeon.AbstractLevelGenerator |
getDefaultTerrain, getDownstairArchetype, getFloorArchetype, getHeight, getOOBTerrain, getUpstairArchetype, getWidth, instantiateFloor, instantiateObject, rand, setDefaultTerrain, setDownstairArchetype, setFloorArchetype, setHeight, setOOBTerrain, setUpstairArchetype, setWidth |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int DEFAULT_CAVE_WIDTH
public static final int DEFAULT_CAVE_HEIGHT
public static final int DEFAULT_DENSITY
public static final int DEFAULT_HIDDEN_CHANCE
public static final int DEFAULT_SECRET_CHANCE
public static final int DEFAULT_MIN_ROOMS
public static final java.lang.String DEFAULT_CAVE_WALL
public static final java.lang.String DEFAULT_CAVE_FLOOR
Constructor Detail |
public CaveGenerator()
Method Detail |
public void setDensity(int density)
public int getDensity()
public void setSecretChance(int chance)
public int getSecretChance()
public void setMinRooms(int rooms)
public int getMinRooms()
public GameMap generate(java.lang.Class mapclass) throws java.lang.Exception
generate
in class AbstractLevelGenerator
mapclass
- the class to instantiate
java.lang.Exception
public void generateCaves()
public static void main(java.lang.String[] argv)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |