Modifier and Type | Class and Description |
---|---|
static class |
Spill.Measurement
The type of heuristic to use.
|
Modifier and Type | Field and Description |
---|---|
int |
filled
The amount of cells filled by this Spill, which may be less than the volume passed to start() if the boundaries
are reached on all sides and the Spill has no more room to fill.
|
int |
height
Height of the map.
|
LightRNG |
lrng
The LightRNG used as a RandomnessSource for the RNG this object uses.
|
Spill.Measurement |
measurement
This affects how distance is measured on diagonal directions vs.
|
boolean[][] |
physicalMap
Stores which parts of the map are accessible (with a value of true) and which are not (with a value of false,
including both walls and unreachable sections of the map).
|
StatefulRNG |
rng
The RNG used to decide which one of multiple equally-short paths to take.
|
boolean[][] |
spillMap
The cells that are filled by the Spill when it reaches its volume or limits will be true; others will be false.
|
ArrayList<Coord> |
spreadPattern
The list of points that the Spill will randomly fill, starting with what is passed to start(), in order of when
they are reached.
|
int |
width
Width of the map.
|
Constructor and Description |
---|
Spill()
Construct a Spill without a level to actually scan.
|
Spill(boolean[][] level)
Used to construct a Spill from the output of another.
|
Spill(boolean[][] level,
Spill.Measurement measurement)
Used to construct a Spill from the output of another, specifying a distance calculation.
|
Spill(char[][] level)
Constructor meant to take a char[][] returned by DungeonGen.generate(), or any other
char[][] where '#' means a wall and anything else is a walkable tile.
|
Spill(char[][] level,
char alternateWall)
Constructor meant to take a char[][] returned by DungeonGen.generate(), or any other
char[][] where one char means a wall and anything else is a walkable tile.
|
Spill(char[][] level,
Spill.Measurement measurement)
Constructor meant to take a char[][] returned by DungeonGen.generate(), or any other
char[][] where '#' means a wall and anything else is a walkable tile.
|
Spill(char[][] level,
Spill.Measurement measurement,
LightRNG random)
Constructor meant to take a char[][] returned by DungeonGen.generate(), or any other
char[][] where '#' means a wall and anything else is a walkable tile.
|
Spill(char[][] level,
Spill.Measurement measurement,
RNG random)
Constructor meant to take a char[][] returned by DungeonGen.generate(), or any other
char[][] where '#' means a wall and anything else is a walkable tile.
|
Spill(LightRNG random)
Construct a Spill without a level to actually scan.
|
Spill(RNG random)
Construct a Spill without a level to actually scan.
|
Modifier and Type | Method and Description |
---|---|
Spill |
initialize(boolean[][] level)
Used to initialize or re-initialize a Spill that needs a new PhysicalMap because it either wasn't given
one when it was constructed, or because the contents of the terrain have changed permanently (not if a
creature moved; for that you pass the positions of creatures that block paths to scan() or findPath() ).
|
Spill |
initialize(char[][] level)
Used to initialize or re-initialize a Spill that needs a new PhysicalMap because it either wasn't given
one when it was constructed, or because the contents of the terrain have changed permanently (not if a
creature moved; for that you pass the positions of creatures that block paths to scan() or findPath() ).
|
Spill |
initialize(char[][] level,
char alternateWall)
Used to initialize or re-initialize a Spill that needs a new PhysicalMap because it either wasn't given
one when it was constructed, or because the contents of the terrain have changed permanently (not if a
creature moved; for that you pass the positions of creatures that block paths to scan() or findPath() ).
|
void |
reset()
Resets this Spill to a state with an empty spillMap and an empty spreadPattern.
|
void |
resetCell(Coord pt)
Reverts a cell to an unfilled state (false in spillMap).
|
void |
resetCell(int x,
int y)
Reverts a cell to an unfilled state (false in spillMap).
|
void |
resetMap()
Resets the spillMap to being empty.
|
protected void |
setFresh(Coord pt) |
protected void |
setFresh(int x,
int y) |
ArrayList<Coord> |
start(Coord entry,
int volume,
Set<Coord> impassable)
Recalculate the spillMap and return the spreadPattern.
|
public Spill.Measurement measurement
public boolean[][] physicalMap
public boolean[][] spillMap
public ArrayList<Coord> spreadPattern
public int height
public int width
public int filled
public StatefulRNG rng
public Spill()
public Spill(RNG random)
public Spill(LightRNG random)
public Spill(boolean[][] level)
level
- public Spill(boolean[][] level, Spill.Measurement measurement)
level
- measurement
- public Spill(char[][] level)
level
- public Spill(char[][] level, char alternateWall)
level
- public Spill(char[][] level, Spill.Measurement measurement)
level
- measurement
- public Spill(char[][] level, Spill.Measurement measurement, RNG random)
level
- measurement
- public Spill(char[][] level, Spill.Measurement measurement, LightRNG random)
level
- measurement
- public Spill initialize(boolean[][] level)
level
- public Spill initialize(char[][] level)
level
- public Spill initialize(char[][] level, char alternateWall)
level
- alternateWall
- public void resetMap()
public void reset()
public void resetCell(int x, int y)
x
- y
- public void resetCell(Coord pt)
pt
- protected void setFresh(int x, int y)
public ArrayList<Coord> start(Coord entry, int volume, Set<Coord> impassable)
entry
- The first cell to spread from, which should really be passable.volume
- The total number of cells to attempt to fill, which must be non-negative.impassable
- A Set of Position keys representing the locations of moving obstacles to a
path that cannot be moved through; this can be null if there are no such obstacles.Copyright © 2012–2016. All rights reserved.