public class SerpentDeepMapGenerator
extends java.lang.Object
Constructor and Description |
---|
SerpentDeepMapGenerator(int width,
int height,
int depth,
IRNG rng)
This prepares a map generator that will generate a map with the given width, height and depth, using the given
IRNG.
|
SerpentDeepMapGenerator(int width,
int height,
int depth,
IRNG rng,
double branchingChance)
This prepares a map generator that will generate a map with the given width, height and depth, using the given
IRNG, and will branch out to other nearby rooms that (probably) do not have staircases between layers.
|
Modifier and Type | Method and Description |
---|---|
char[][][] |
generate()
This generates a new map by stretching a 32x32x(multiple of 8) grid of potential rooms to fit the width, height,
and depth passed to the constructor, randomly expanding columns and rows before contracting the whole to fit
perfectly.
|
int[][] |
getEnvironment(int level)
Gets a 2D int array representing the environment for the requested level.
|
int[][][] |
getEnvironments()
Gets an array (length equals depth) of 2D int arrays representing the environments for levels.
|
void |
putBoxRoomCarvers(int count)
Changes the number of "carvers" that will create right-angle corridors from one room to the next, create rooms
with a random size in a box shape at the start and end, and a small room at the corner if there is one.
|
void |
putCaveCarvers(int count)
Changes the number of "carvers" that will create caves from one room to the next.
|
void |
putRoundRoomCarvers(int count)
Changes the number of "carvers" that will create right-angle corridors from one room to the next, create rooms
with a random size in a circle shape at the start and end, and a small circular room at the corner if there is
one.
|
void |
putWalledBoxRoomCarvers(int count)
Changes the number of "carvers" that will create right-angle corridors from one room to the next, create rooms
with a random size in a box shape at the start and end, and a small room at the corner if there is one.
|
void |
putWalledRoundRoomCarvers(int count)
Changes the number of "carvers" that will create right-angle corridors from one room to the next, create rooms
with a random size in a circle shape at the start and end, and a small circular room at the corner if there is
one.
|
public SerpentDeepMapGenerator(int width, int height, int depth, IRNG rng)
width
- the width of the final map in cellsheight
- the height of the final map in cellsdepth
- the number of levels deep to createrng
- an IRNG object to use for random choices; this make a lot of random choices.MixedGenerator
public SerpentDeepMapGenerator(int width, int height, int depth, IRNG rng, double branchingChance)
width
- the width of the final map in cellsheight
- the height of the final map in cellsdepth
- the number of levels deep to createrng
- an IRNG object to use for random choices; this make a lot of random choices.branchingChance
- the odds from 0.0 to 1.0 that a branch will be created near each necessary room.MixedGenerator
public void putCaveCarvers(int count)
count
- the number of carvers making caves between rooms; only matters in relation to other carversMixedGenerator
public void putBoxRoomCarvers(int count)
count
- the number of carvers making box-shaped rooms and corridors between them; only matters in relation
to other carversMixedGenerator
public void putWalledBoxRoomCarvers(int count)
count
- the number of carvers making box-shaped rooms and corridors between them; only matters in relation
to other carversMixedGenerator
public void putRoundRoomCarvers(int count)
count
- the number of carvers making circular rooms and corridors between them; only matters in relation
to other carversMixedGenerator
public void putWalledRoundRoomCarvers(int count)
count
- the number of carvers making circular rooms and corridors between them; only matters in relation
to other carversMixedGenerator
public char[][][] generate()
MixedGenerator
public int[][][] getEnvironments()
public int[][] getEnvironment(int level)
level
- the level to get from the generated dungeon; will be clamped between 0 and depth - 1Copyright © Eben Howard 2012–2022. All rights reserved.