Package squidpony.squidgrid.mapping
Class OrganicMapGenerator
java.lang.Object
squidpony.squidgrid.mapping.OrganicMapGenerator
- All Implemented Interfaces:
IDungeonGenerator
public class OrganicMapGenerator extends Object implements IDungeonGenerator
Map generator using Simplex noise for the formation of "rooms" and then WobblyLine to connect with corridors.
Created by Tommy Ettinger on 4/18/2016.
-
Field Summary
-
Constructor Summary
Constructors Constructor Description OrganicMapGenerator()OrganicMapGenerator(double noiseMin, double noiseMax, int width, int height, IRNG rng)OrganicMapGenerator(int width, int height)OrganicMapGenerator(int width, int height, IRNG rng) -
Method Summary
Modifier and Type Method Description char[][]generate()Generate a map as a 2D char array using the width and height specified in the constructor.char[][]getDungeon()Gets the most recently-produced dungeon as a 2D char array, usually produced by callingIDungeonGenerator.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.intgetHeight()doublegetNoiseMax()doublegetNoiseMin()intgetWidth()voidsetHeight(int height)voidsetNoiseMax(double noiseMax)voidsetNoiseMin(double noiseMin)voidsetWidth(int width)
-
Field Details
-
Constructor Details
-
Method Details
-
generate
Generate a map as a 2D char array using the width and height specified in the constructor. Should produce an organic, cave-like map.- Specified by:
generatein interfaceIDungeonGenerator- Returns:
- a 2D char array for the map that should be organic-looking.
-
getEnvironment
Gets a 2D array of int constants, each representing a type of environment corresponding to a static field of MixedGenerator. This array will have the same size as the last char 2D array produced by generate(); the value of this method if called before generate() is undefined, but probably will be a 2D array of all 0 (UNTOUCHED).- MixedGenerator.UNTOUCHED, equal to 0, is used for any cells that aren't near a floor.
- MixedGenerator.ROOM_FLOOR, equal to 1, is used for floor cells inside wide room areas.
- MixedGenerator.ROOM_WALL, equal to 2, is used for wall cells around wide room areas.
- MixedGenerator.CAVE_FLOOR, equal to 3, is used for floor cells inside rough cave areas.
- MixedGenerator.CAVE_WALL, equal to 4, is used for wall cells around rough cave areas.
- MixedGenerator.CORRIDOR_FLOOR, equal to 5, is used for floor cells inside narrow corridor areas.
- MixedGenerator.CORRIDOR_WALL, equal to 6, is used for wall cells around narrow corridor areas.
- Returns:
- a 2D int array where each element is an environment type constant in MixedGenerator
-
getDungeon
Description copied from interface:IDungeonGeneratorGets the most recently-produced dungeon as a 2D char array, usually produced by callingIDungeonGenerator.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.- Specified by:
getDungeonin interfaceIDungeonGenerator- Returns:
- the most recently-produced dungeon/map as a 2D char array
-
getWidth
-
setWidth
-
getHeight
-
setHeight
-
getNoiseMin
-
setNoiseMin
-
getNoiseMax
-
setNoiseMax
-