public class SerpentMapGenerator extends java.lang.Object implements IDungeonGenerator
| Constructor and Description |
|---|
SerpentMapGenerator(int width,
int height,
IRNG rng)
This prepares a map generator that will generate a map with the given width and height, using the given IRNG.
|
SerpentMapGenerator(int width,
int height,
IRNG random,
boolean symmetrical)
This prepares a map generator that will generate a map with the given width and height, using the given IRNG.
|
SerpentMapGenerator(int width,
int height,
IRNG rng,
double branchingChance)
This prepares a map generator that will generate a map with the given width and height, using the given IRNG.
|
SerpentMapGenerator(int width,
int height,
IRNG random,
double branchingChance,
boolean symmetrical)
This prepares a map generator that will generate a map with the given width and height, using the given IRNG.
|
| Modifier and Type | Method and Description |
|---|---|
char[][] |
generate()
This generates a new map by stretching a 16x16 grid of potential rooms to fit the width and height passed to the
constructor, randomly expanding columns and rows before contracting the whole to fit perfectly.
|
char[][] |
getDungeon()
Gets the most recently-produced dungeon as a 2D char array, usually produced by calling
IDungeonGenerator.generate() or
some similar method present in a specific implementation. |
int[][] |
getEnvironment()
Gets a 2D array of int constants, each representing a type of environment corresponding to a static field of
MixedGenerator.
|
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 SerpentMapGenerator(int width,
int height,
IRNG rng)
width - the width of the final map in cellsheight - the height of the final map in cellsrng - an IRNG object to use for random choices; this make a lot of random choices.MixedGeneratorpublic SerpentMapGenerator(int width,
int height,
IRNG random,
boolean symmetrical)
width - the width of the final map in cellsheight - the height of the final map in cellsrandom - an IRNG object to use for random choices; this make a lot of random choices.symmetrical - true if this should generate a bi-radially symmetric map, false for a typical mapMixedGeneratorpublic SerpentMapGenerator(int width,
int height,
IRNG rng,
double branchingChance)
width - the width of the final map in cellsheight - the height of the final map in cellsrng - an IRNG object to use for random choices; this make a lot of random choices.branchingChance - the chance from 0.0 to 1.0 that each room will branch at least onceMixedGeneratorpublic SerpentMapGenerator(int width,
int height,
IRNG random,
double branchingChance,
boolean symmetrical)
width - the width of the final map in cellsheight - the height of the final map in cellsrandom - an IRNG object to use for random choices; this make a lot of random choices.branchingChance - the chance from 0.0 to 1.0 that each room will branch at least oncesymmetrical - true if this should generate a bi-radially symmetric map, false for a typical mapMixedGeneratorpublic void putCaveCarvers(int count)
count - the number of carvers making caves between rooms; only matters in relation to other carversMixedGeneratorpublic void putBoxRoomCarvers(int count)
count - the number of carvers making box-shaped rooms and corridors between them; only matters in relation
to other carversMixedGeneratorpublic void putWalledBoxRoomCarvers(int count)
count - the number of carvers making box-shaped rooms and corridors between them; only matters in relation
to other carversMixedGeneratorpublic void putRoundRoomCarvers(int count)
count - the number of carvers making circular rooms and corridors between them; only matters in relation
to other carversMixedGeneratorpublic void putWalledRoundRoomCarvers(int count)
count - the number of carvers making circular rooms and corridors between them; only matters in relation
to other carversMixedGeneratorpublic char[][] generate()
generate in interface IDungeonGeneratorMixedGeneratorpublic int[][] getEnvironment()
public char[][] getDungeon()
IDungeonGeneratorIDungeonGenerator.generate() or
some similar method present in a specific implementation. This normally passes a direct reference and not a copy,
so you can normally modify the returned array to propagate changes back into this IDungeonGenerator.getDungeon in interface IDungeonGeneratorCopyright © Eben Howard 2012–2022. All rights reserved.