public class DungeonBoneGen extends Object
Modifier and Type | Field and Description |
---|---|
RNG |
rng
The current RNG, a squidpony.squidmath.RNG
|
Constructor and Description |
---|
DungeonBoneGen()
Constructs a DungeonGen that uses the default RNG.
|
DungeonBoneGen(Random random)
Constructs a DungeonGen that uses the given java.util.Random .
|
DungeonBoneGen(RNG random)
Constructs a DungeonGen that uses the given squidpony.squidmath.RNG.
|
Modifier and Type | Method and Description |
---|---|
char[][] |
generate(Tileset ts,
int w,
int h)
Generate a dungeon given a Tileset.
|
char[][] |
generate(TilesetType tt,
int w,
int h)
Generate a dungeon given a TilesetType enum.
|
char |
get(int x,
int y)
Gets the char at a given x,y position.
|
char[][] |
getDungeon()
Get the char[][] dungeon that was last returned by generate(), or null if generate() or setDungeon have not been
called.
|
int |
getHeight()
Returns the height, used as the second coordinate in any char[][] in this class.
|
RNG |
getRng()
Gets the current RNG.
|
String[][] |
getTiles(TilesetType tt)
Gets an array of all herringbone tiles associated with a TilesetType enum.
|
int |
getWidth()
Returns the width, used as the first coordinate in any char[][] in this class.
|
void |
put(char elem,
int x,
int y)
Sets the char at the given x,y position, storing it in this object.
|
void |
setDungeon(char[][] dungeon)
Change the stored char[][] dungeon, using x,y indexing.
|
void |
setRng(RNG rng)
Sets the current RNG.
|
String |
toString()
Provides a string representation of the latest generated dungeon.
|
char[][] |
wallWrap()
Changes the outer edge of this dungeon to the wall char, '#'.
|
static char[][] |
wallWrap(char[][] map)
Changes the outer edge of a char[][] to the wall char, '#'.
|
public DungeonBoneGen(Random random)
random
- A Random number generator to be used during the dungeon generation; it will
be used to generate a seed for the internal RNG this class uses.public DungeonBoneGen(RNG random)
random
- A squidpony.squidmath.RNG to be used during the dungeon generation.public DungeonBoneGen()
public int getWidth()
public int getHeight()
public char[][] getDungeon()
public void setDungeon(char[][] dungeon)
dungeon
- public char get(int x, int y)
x
- y
- public void put(char elem, int x, int y)
elem
- x
- y
- public char[][] generate(TilesetType tt, int w, int h)
tt
- A TilesetType enum; try lots of these out to see how they look.w
- Width of the dungeon to generate in chars.h
- Height of the dungeon to generate in chars.public static char[][] wallWrap(char[][] map)
map
- A char[][] that stores map data.public char[][] wallWrap()
public char[][] generate(Tileset ts, int w, int h)
ts
- A Tileset; if you don't have one of these available, use a TilesetType enum instead to select a predefined one.h
- Height of the dungeon to generate in chars.w
- Width of the dungeon to generate in chars.public String[][] getTiles(TilesetType tt)
tt
- a TilesetType enumCopyright © 2012–2016. All rights reserved.