public class SymmetryDungeonGenerator extends MixedGenerator
MixedGenerator
that creates bi-radially symmetric maps (basically a yin-yang shape). Useful for
strategy games and possibly competitive multi-player games. The Coords passed to constructors as room positions do
not necessarily need to be symmetrical already; they will be duplicated in their mirror position in the dungeon.
Created by Tommy Ettinger on 11/20/2015.BOX, BOX_WALLED, carvers, carverTable, CAVE, CAVE_FLOOR, CAVE_WALL, CORRIDOR_FLOOR, CORRIDOR_WALL, dungeon, environment, fixedRooms, generated, height, marked, points, rng, ROOM_FLOOR, ROOM_WALL, roomHeight, roomWidth, ROUND, ROUND_WALLED, totalPoints, UNTOUCHED, walled, width
Constructor and Description |
---|
SymmetryDungeonGenerator(int width,
int height,
IRNG rng)
This prepares a map generator that will generate a map with the given width and height, using the given RNG.
|
SymmetryDungeonGenerator(int width,
int height,
IRNG rng,
java.util.List<Coord> sequence)
This prepares a map generator that will generate a map with the given width and height, using the given RNG.
|
SymmetryDungeonGenerator(int width,
int height,
IRNG rng,
OrderedMap<Coord,java.util.List<Coord>> connections)
This prepares a map generator that will generate a map with the given width and height, using the given RNG.
|
SymmetryDungeonGenerator(int width,
int height,
IRNG rng,
OrderedMap<Coord,java.util.List<Coord>> connections,
float roomSizeMultiplier)
This prepares a map generator that will generate a map with the given width and height, using the given RNG.
|
SymmetryDungeonGenerator(int width,
int height,
IRNG rng,
OrderedSet<Coord> sequence)
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 |
---|---|
protected static OrderedMap<Coord,java.util.List<Coord>> |
crossConnect(int width,
int height,
java.util.Map<Coord,java.util.List<Coord>> connections) |
protected static OrderedMap<Coord,java.util.List<Coord>> |
listToMap(java.util.List<Coord> sequence) |
protected boolean |
mark(int x,
int y)
Internal use.
|
protected void |
markEnvironment(int x,
int y,
int kind)
Internal use.
|
protected void |
markPiercing(int x,
int y)
Internal use.
|
static OrderedMap<Coord,java.util.List<Coord>> |
removeSomeOverlap(int width,
int height,
java.util.Collection<Coord> sequence) |
static OrderedMap<Coord,java.util.List<Coord>> |
removeSomeOverlap(int width,
int height,
java.util.Map<Coord,java.util.List<Coord>> connections) |
protected static OrderedMap<Coord,java.util.List<Coord>> |
setToMap(OrderedSet<Coord> sequence) |
protected void |
wallOff(int x,
int y)
Internal use.
|
basicPoints, cleanPoints, generate, getDungeon, getEnvironment, getFixedRooms, hasGenerated, mark, markEnvironmentCave, markEnvironmentCorridor, markEnvironmentRoom, markEnvironmentWalls, markPiercing, markPiercingCave, markPiercingRoom, putBoxRoomCarvers, putCaveCarvers, putRoundRoomCarvers, putWalledBoxRoomCarvers, putWalledRoundRoomCarvers, setFixedRooms, store
public SymmetryDungeonGenerator(int width, int height, IRNG rng)
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.used to ensure spacing for the points.
public SymmetryDungeonGenerator(int width, int height, IRNG rng, java.util.List<Coord> sequence)
width
- the width of the final map in cellsheight
- the height of the final map in cellsrng
- an IRNG, such as an RNG, to use for random choices; this make a lot of random choices.sequence
- a List of Coord to connect in order; index 0 is the start, index size() - 1 is the end.a class that uses this technique
public SymmetryDungeonGenerator(int width, int height, IRNG rng, OrderedSet<Coord> sequence)
width
- the width of the final map in cellsheight
- the height of the final map in cellsrng
- an IRNG, such as an RNG, to use for random choices; this make a lot of random choices.sequence
- a List of Coord to connect in order; index 0 is the start, index size() - 1 is the end.a class that uses this technique
public SymmetryDungeonGenerator(int width, int height, IRNG rng, OrderedMap<Coord,java.util.List<Coord>> connections)
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.connections
- a Map of Coord keys to arrays of Coord to connect to next; shouldn't connect both waysa class that uses this technique
public SymmetryDungeonGenerator(int width, int height, IRNG rng, OrderedMap<Coord,java.util.List<Coord>> connections, float roomSizeMultiplier)
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.connections
- a Map of Coord keys to arrays of Coord to connect to next; shouldn't connect both waysroomSizeMultiplier
- a float multiplier that will be applied to each room's width and heighta class that uses this technique
public static OrderedMap<Coord,java.util.List<Coord>> removeSomeOverlap(int width, int height, java.util.Collection<Coord> sequence)
public static OrderedMap<Coord,java.util.List<Coord>> removeSomeOverlap(int width, int height, java.util.Map<Coord,java.util.List<Coord>> connections)
protected static OrderedMap<Coord,java.util.List<Coord>> listToMap(java.util.List<Coord> sequence)
protected static OrderedMap<Coord,java.util.List<Coord>> setToMap(OrderedSet<Coord> sequence)
protected static OrderedMap<Coord,java.util.List<Coord>> crossConnect(int width, int height, java.util.Map<Coord,java.util.List<Coord>> connections)
protected boolean mark(int x, int y)
mark
in class MixedGenerator
x
- x position to marky
- y position to markprotected void markPiercing(int x, int y)
markPiercing
in class MixedGenerator
x
- x position to marky
- y position to markprotected void wallOff(int x, int y)
wallOff
in class MixedGenerator
x
- x position to marky
- y position to markprotected void markEnvironment(int x, int y, int kind)
markEnvironment
in class MixedGenerator
x
- x position to marky
- y position to markkind
- an int that should be one of the constants in MixedGenerator for environment types.Copyright © Eben Howard 2012–2022. All rights reserved.