@Deprecated public class LegacyDungeonGenerator extends DungeonGenerator
this class exposes a DungeonUtility member; DungeonUtility also has many useful static methods
,
for more-precise behavior
DungeonGenerator.FillEffect
dungeon, fx, gen, height, rebuildSeed, rng, seedFixed, stairsDown, stairsUp, utility, width
Constructor and Description |
---|
LegacyDungeonGenerator()
Deprecated.
Make a DungeonGenerator with a LightRNG using a random seed, height 40, and width 40.
|
LegacyDungeonGenerator(DungeonGenerator copying)
Deprecated.
Copies all fields from copying and makes a new DungeonGenerator.
|
LegacyDungeonGenerator(int width,
int height)
Deprecated.
Make a DungeonGenerator with the given height and width; the RNG used for generating a dungeon and
adding features will be a LightRNG using a random seed.
|
LegacyDungeonGenerator(int width,
int height,
RNG rng)
Deprecated.
Make a DungeonGenerator with the given height, width, and RNG.
|
Modifier and Type | Method and Description |
---|---|
DungeonGenerator |
addBoulders(int percentage)
Deprecated.
Turns the given percentage of floor cells not already adjacent to walls into wall cells, represented by '#'.
|
DungeonGenerator |
addDoors(int percentage,
boolean doubleDoors)
Deprecated.
Turns the given percentage of viable doorways into doors, represented by '+' for doors that allow travel along
the x-axis and '/' for doors that allow travel along the y-axis.
|
DungeonGenerator |
addGrass(int percentage)
Deprecated.
Turns the majority of the given percentage of floor cells into grass cells, represented by '"'.
|
DungeonGenerator |
addTraps(int percentage)
Deprecated.
Turns the given percentage of open area floor cells into trap cells, represented by '^'.
|
DungeonGenerator |
addWater(int percentage)
Deprecated.
Turns the majority of the given percentage of floor cells into water cells, represented by '~'.
|
DungeonGenerator |
addWater(int percentage,
int islandSpacing)
Deprecated.
Turns the majority of the given percentage of floor cells into water cells, represented by '~'.
|
DungeonGenerator |
clearEffects()
Deprecated.
Removes any door, water, or trap insertion effects that this DungeonGenerator would put in future dungeons.
|
char[][] |
generate()
Deprecated.
Generate a char[][] dungeon using TilesetType.DEFAULT_DUNGEON; this produces a dungeon appropriate for a level
of ruins or a partially constructed dungeon.
|
char[][] |
generate(char[][] baseDungeon)
Deprecated.
Generate a char[][] dungeon with extra features given a baseDungeon that has already been generated.
|
char[][] |
generate(TilesetType kind)
Deprecated.
Generate a char[][] dungeon given a TilesetType; the comments in that class provide some opinions on what
each TilesetType value could be used for in a game.
|
char[][] |
generateRespectingStairs(char[][] baseDungeon)
Deprecated.
Generate a char[][] dungeon with extra features given a baseDungeon that has already been generated, and that
already has staircases represented by greater than and less than signs.
|
char[][] |
getBareDungeon()
Deprecated.
Get the most recently generated char[][] dungeon out of this class without any chars other than '#' or '.', for
walls and floors respectively.
|
char[][] |
getDungeon()
Deprecated.
Get the most recently generated char[][] dungeon out of this class.
|
int |
getHeight()
Deprecated.
Height of the dungeon in cells.
|
long |
getRebuildSeed()
Deprecated.
Gets the seed that can be used to rebuild an identical dungeon to the latest one generated (or the seed that
will be used to generate the first dungeon if none has been made yet).
|
int |
getWidth()
Deprecated.
Width of the dungeon in cells.
|
protected LinkedHashSet<Coord> |
removeAdjacent(LinkedHashSet<Coord> coll,
Coord pt)
Deprecated.
|
protected LinkedHashSet<Coord> |
removeAdjacent(LinkedHashSet<Coord> coll,
Coord pt1,
Coord pt2)
Deprecated.
|
void |
setDungeon(char[][] dungeon)
Deprecated.
Change the underlying char[][]; only affects the toString method, and of course getDungeon.
|
String |
toString()
Deprecated.
Provides a string representation of the latest generated dungeon.
|
protected LinkedHashSet<Coord> |
viableDoorways(boolean doubleDoors,
char[][] map)
Deprecated.
|
public LegacyDungeonGenerator()
public LegacyDungeonGenerator(int width, int height)
width
- The width of the dungeon in cells.height
- The height of the dungeon in cells.public LegacyDungeonGenerator(int width, int height, RNG rng)
width
- The width of the dungeon in cells.height
- The height of the dungeon in cells.rng
- The RNG to use for all purposes in this class; if this has been seeded and you want the samepublic LegacyDungeonGenerator(DungeonGenerator copying)
copying
- public char[][] getDungeon()
getDungeon
in class DungeonGenerator
public char[][] getBareDungeon()
getBareDungeon
in class DungeonGenerator
public void setDungeon(char[][] dungeon)
setDungeon
in class DungeonGenerator
dungeon
- a char[][], probably produced by an earlier call to this class and then modified.public int getHeight()
getHeight
in class DungeonGenerator
public int getWidth()
getWidth
in class DungeonGenerator
public DungeonGenerator addWater(int percentage)
addWater
in class DungeonGenerator
percentage
- the percentage of floor cells to fill with water; this can vary quite a lot. It is not
intended to allow filling very high (over 66%) percentages of map with water, though you can do
this by giving a percentage of between 100 and 150.public DungeonGenerator addWater(int percentage, int islandSpacing)
addWater
in class DungeonGenerator
percentage
- the percentage of floor cells to fill with water; this can vary quite a lot. It may be
difficult to fill very high (over 66%) percentages of map with water, though you can do this by
giving a percentage of between 100 and 150.islandSpacing
- if greater than 1, islands will be placed randomly this many cells apart.public DungeonGenerator addGrass(int percentage)
addGrass
in class DungeonGenerator
percentage
- the percentage of floor cells to fill with grass; this can vary quite a lot. It may be
difficult to fill very high (over 66%) percentages of map with grass, though you can do this by
giving a percentage of between 100 and 150.public DungeonGenerator addBoulders(int percentage)
addBoulders
in class DungeonGenerator
percentage
- the percentage of floor cells not adjacent to walls to fill with boulders.public DungeonGenerator addDoors(int percentage, boolean doubleDoors)
addDoors
in class DungeonGenerator
percentage
- the percentage of valid openings to corridors to fill with doors; should be between 10 and
20 if you want doors to appear more than a few times, but not fill every possible opening.doubleDoors
- true if you want two-cell-wide openings to receive a door and a wall; false if only
one-cell-wide openings should receive doors. Usually, this should be true.public DungeonGenerator addTraps(int percentage)
addTraps
in class DungeonGenerator
percentage
- the percentage of valid cells to fill with traps; should be no higher than 5 unless
the dungeon floor is meant to be a kill screen or minefield.public DungeonGenerator clearEffects()
clearEffects
in class DungeonGenerator
protected LinkedHashSet<Coord> removeAdjacent(LinkedHashSet<Coord> coll, Coord pt)
removeAdjacent
in class DungeonGenerator
protected LinkedHashSet<Coord> removeAdjacent(LinkedHashSet<Coord> coll, Coord pt1, Coord pt2)
removeAdjacent
in class DungeonGenerator
protected LinkedHashSet<Coord> viableDoorways(boolean doubleDoors, char[][] map)
viableDoorways
in class DungeonGenerator
public char[][] generate()
generate
in class DungeonGenerator
public char[][] generate(TilesetType kind)
generate
in class DungeonGenerator
kind
- a TilesetType enum value, such as TilesetType.DEFAULT_DUNGEONTilesetType
public char[][] generate(char[][] baseDungeon)
generate
in class DungeonGenerator
baseDungeon
- a pre-made dungeon consisting of '#' for walls and '.' for floorspublic char[][] generateRespectingStairs(char[][] baseDungeon)
generateRespectingStairs
in class DungeonGenerator
baseDungeon
- a pre-made dungeon consisting of '#' for walls and '.' for floors, with stairs already inpublic long getRebuildSeed()
getRebuildSeed
in class DungeonGenerator
public String toString()
toString
in class DungeonGenerator
Copyright © 2012–2016. All rights reserved.