Package squidpony.squidgrid.mapping
Class BasicCaveGenerator
java.lang.Object
squidpony.squidgrid.mapping.BasicCaveGenerator
- All Implemented Interfaces:
IDungeonGenerator
public class BasicCaveGenerator extends Object implements IDungeonGenerator
-
Field Summary
-
Constructor Summary
Constructors Constructor Description BasicCaveGenerator()
BasicCaveGenerator(int width, int height)
BasicCaveGenerator(int width, int height, IRNG random)
-
Method Summary
Modifier and Type Method Description char[][]
generate()
Generates a dungeon or other map as a 2D char array.char[][]
getDungeon()
Gets the most recently-produced dungeon as a 2D char array, usually produced by callinggenerate()
or some similar method present in a specific implementation.
-
Field Details
-
Constructor Details
-
Method Details
-
generate
Generates a dungeon or other map as a 2D char array. Any implementation may allow its own configuration and customization of how dungeons are generated, but each must provide this as a sane default. Most implementations should use the convention of '#' representing a wall and '.' representing a bare floor, but beyond that, anything could be present in the char array.- Specified by:
generate
in interfaceIDungeonGenerator
- Returns:
- a 2D char array representing some kind of map, probably using standard conventions for walls/floors
-
getDungeon
Gets the most recently-produced dungeon as a 2D char array, usually produced by callinggenerate()
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.- Specified by:
getDungeon
in interfaceIDungeonGenerator
- Returns:
- the most recently-produced dungeon/map as a 2D char array
-