|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object wyvern.kernel.dungeon.AbstractLevelGenerator
Common code for maze, dungeon, and cave generators.
Field Summary | |
static int |
DEFAULT_HEIGHT
|
static int |
DEFAULT_WIDTH
|
protected java.lang.String |
floor_
|
protected int |
height_
|
protected java.lang.String |
oobTerrain_
|
protected java.lang.String |
stairsDown_
|
protected java.lang.String |
stairsUp_
|
protected java.lang.String |
terrain_
|
protected int |
width_
|
Constructor Summary | |
AbstractLevelGenerator()
|
Method Summary | |
abstract GameMap |
generate(java.lang.Class mapclass)
Creates and returns a GameMap using the current set of properties for this generator. |
java.lang.String |
getDefaultTerrain()
|
java.lang.String |
getDownstairArchetype()
|
java.lang.String |
getFloorArchetype()
|
int |
getHeight()
|
java.lang.String |
getOOBTerrain()
|
java.lang.String |
getUpstairArchetype()
|
int |
getWidth()
|
protected Terrain |
instantiateFloor()
Instantiates the current floor archetype. |
protected GameObject |
instantiateObject(java.lang.String archname)
Instantiates an archetype by name. |
protected int |
rand(int num)
produces a random value between 0 and num |
void |
setDefaultTerrain(java.lang.String t)
Sets the default terrain to use for the generated maps. |
void |
setDownstairArchetype(java.lang.String arch)
Sets the arch to use for the down-staircase, if any. |
void |
setFloorArchetype(java.lang.String name)
Sets the archetype to use for the floor in places that differ from the default terrain, if appropriate. |
void |
setHeight(int height)
|
void |
setOOBTerrain(java.lang.String t)
Sets the default out-of-bounds terrain to use for the generated maps. |
void |
setUpstairArchetype(java.lang.String arch)
Sets the arch to use for the up-staircase, if any. |
void |
setWidth(int width)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.lang.String terrain_
protected java.lang.String oobTerrain_
protected java.lang.String floor_
protected java.lang.String stairsUp_
protected java.lang.String stairsDown_
protected int width_
protected int height_
public static final int DEFAULT_WIDTH
public static final int DEFAULT_HEIGHT
Constructor Detail |
public AbstractLevelGenerator()
Method Detail |
public abstract GameMap generate(java.lang.Class mapclass) throws java.lang.Exception
mapclass
- the class to instantiate
java.lang.Exception
public void setDefaultTerrain(java.lang.String t)
t
- the terrain archetype to use, e.g. "terrain/cave_floor"public java.lang.String getDefaultTerrain()
public void setOOBTerrain(java.lang.String t)
t
- the terrain archetype to use, e.g. "terrain/cave_floor"public java.lang.String getOOBTerrain()
public void setFloorArchetype(java.lang.String name)
name
- the archetype to use, e.g. "terrain/gray_brick"public java.lang.String getFloorArchetype()
public void setWidth(int width)
public int getWidth()
public void setHeight(int height)
public int getHeight()
public void setUpstairArchetype(java.lang.String arch)
arch
- the archetype local path, e.g. "indoor/stairs_upE"public java.lang.String getUpstairArchetype()
public void setDownstairArchetype(java.lang.String arch)
arch
- the archetype local path, e.g. "indoor/stairs_downE"public java.lang.String getDownstairArchetype()
protected GameObject instantiateObject(java.lang.String archname)
archname
- the archetype to instantiate
protected Terrain instantiateFloor()
protected int rand(int num)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |