public class LanesMapGenerator extends java.lang.Object implements IDungeonGenerator
Modifier and Type | Field and Description |
---|---|
protected int[] |
columns |
protected int |
lanes |
protected SymmetryDungeonGenerator |
mix |
protected IRNG |
random |
protected int[] |
rows |
Constructor and Description |
---|
LanesMapGenerator(int width,
int height,
IRNG rng,
int lanes)
This prepares a map generator that will generate a map with the given width and height, using the given RNG.
|
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.
|
protected SymmetryDungeonGenerator mix
protected int[] columns
protected int[] rows
protected IRNG random
protected int lanes
public LanesMapGenerator(int width, int height, IRNG rng, int lanes)
width
- the width of the final map in cellsheight
- the height of the final map in cellsrng
- an RNG object to use for random choices; this make a lot of random choices.lanes
- between 1 and 3; the number of wide paths to generate going from upper left to lower right.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()
generate
in interface IDungeonGenerator
MixedGenerator
public int[][] getEnvironment()
public char[][] getDungeon()
IDungeonGenerator
IDungeonGenerator.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 IDungeonGenerator
Copyright © Eben Howard 2012–2022. All rights reserved.