@Beta public class ModularMapGenerator extends Object
Modifier and Type | Field and Description |
---|---|
LinkedHashMap<Coord,MapModule> |
displacement |
protected int[][] |
environment |
protected int |
height |
RegionMap<MapModule> |
layout |
protected char[][] |
map |
LinkedHashMap<Integer,ArrayList<MapModule>> |
modules |
protected long |
rebuildSeed |
StatefulRNG |
rng |
protected boolean |
seedFixed |
DungeonUtility |
utility |
protected int |
width |
Constructor and Description |
---|
ModularMapGenerator()
Make a ModularMapGenerator with a StatefulRNG (backed by LightRNG) using a random seed, height 30, and width 60.
|
ModularMapGenerator(int width,
int height)
Make a ModularMapGenerator with the given height and width; the RNG used for generating a dungeon and
adding features will be a StatefulRNG (backed by LightRNG) using a random seed.
|
ModularMapGenerator(int width,
int height,
RNG rng)
Make a ModularMapGenerator with the given height, width, and RNG.
|
ModularMapGenerator(ModularMapGenerator copying)
Copies all fields from copying and makes a new DungeonGenerator.
|
Modifier and Type | Method and Description |
---|---|
char[][] |
generate() |
char[][] |
getBareMap()
Get the most recently generated char[][] map out of this class without any chars other than '#' or '.', for
walls and floors respectively.
|
int[][] |
getEnvironment()
Gets the environment int 2D array for use with classes like RoomFinder.
|
int |
getHeight()
Height of the map in cells.
|
char[][] |
getMap()
Get the most recently generated char[][] map out of this class.
|
int |
getWidth()
Width of the map in cells.
|
void |
setEnvironment(int[][] environment)
Sets the environment int 2D array.
|
void |
setMap(char[][] map)
Change the underlying char[][]; only affects the toString method, and of course getMap
|
public DungeonUtility utility
protected int height
protected int width
public StatefulRNG rng
protected long rebuildSeed
protected boolean seedFixed
protected char[][] map
protected int[][] environment
public LinkedHashMap<Integer,ArrayList<MapModule>> modules
public LinkedHashMap<Coord,MapModule> displacement
public ModularMapGenerator()
public ModularMapGenerator(int width, int height)
width
- The width of the dungeon in cellsheight
- The height of the dungeon in cellspublic ModularMapGenerator(int width, int height, RNG rng)
width
- The width of the dungeon in cellsheight
- The height of the dungeon in cellsrng
- The RNG to use for all purposes in this class; if it is a StatefulRNG, then it will be used as-is,
but if it is not a StatefulRNG, a new StatefulRNG will be used, randomly seeded by this parameterpublic ModularMapGenerator(ModularMapGenerator copying)
copying
- the DungeonGenerator to copypublic char[][] getMap()
public char[][] getBareMap()
public char[][] generate()
public void setMap(char[][] map)
map
- a char[][], probably produced by an earlier call to this class and then modified.public int getHeight()
public int getWidth()
public int[][] getEnvironment()
public void setEnvironment(int[][] environment)
environment
- a 2D array of int, where each int corresponds to a constant in MixedGenerator.Copyright © 2012–2016. All rights reserved.