public class DividedMazeGenerator extends java.lang.Object implements IDungeonGenerator
'#' and '.'. You may get
better mazes from using GrowingTreeMazeGenerator; this generator produces lots of narrow dead-end hallways.
This dungeon generator is based on a port of the rot.js version.
| Constructor and Description |
|---|
DividedMazeGenerator(int width,
int height)
Sets up the generator to make mazes the given width and height.
|
DividedMazeGenerator(int width,
int height,
IRNG rng)
Sets up the generator to make mazes the given width and height.
|
| Modifier and Type | Method and Description |
|---|---|
char[][] |
generate()
Builds a maze.
|
char[][] |
getDungeon()
Gets the most recently-produced dungeon as a 2D char array, usually produced by calling
generate(). |
public DividedMazeGenerator(int width,
int height)
width - height - public DividedMazeGenerator(int width,
int height,
IRNG rng)
width - in cellsheight - in cellsrng - the random number generator to usepublic char[][] generate()
'#' represents a wall, and '.' represents a floor.generate in interface IDungeonGeneratorpublic char[][] getDungeon()
generate(). This
may reuturn null if generate() has not been called. This 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.