public class RODelegatingTile extends ReadOnlyTile
Tile
which wraps another Tile
and delegates all read calls to it. All write calls throw an
UnsupportedOperationException
.
Intended to change the behaviour of one or more read calls by overriding them.
Tile.Listener, Tile.TileBuffer
InstanceKeeper.InstantiationListener<T>
Modifier and Type | Field and Description |
---|---|
protected Tile |
tile |
bitLayerData, heightMap, layerData, tallHeightMap, tallWaterLevel, terrain, waterLevel
Constructor and Description |
---|
RODelegatingTile(Tile tile) |
Modifier and Type | Method and Description |
---|---|
boolean |
containsOneOf(Layer... layers) |
java.util.List<Layer> |
getActiveLayers(int x,
int y) |
java.util.Set<Terrain> |
getAllTerrains() |
int |
getBitLayerCount(Layer layer,
int x,
int y,
int r)
Count the number of blocks where the specified bit layer is set in a
square around a particular location
|
boolean |
getBitLayerValue(Layer layer,
int x,
int y) |
float |
getDistanceToEdge(Layer layer,
int x,
int y,
float maxDistance) |
int |
getFloodedCount(int x,
int y,
int r,
boolean lava)
Count the number of blocks that are flooded in a square around a
particular location
|
float |
getHeight(int x,
int y) |
int |
getHighestRawHeight() |
int |
getHighestWaterLevel() |
int |
getIntHeight(int x,
int y) |
java.util.List<Layer> |
getLayers() |
java.util.List<Layer> |
getLayers(java.util.Set<Layer> additionalLayers)
Get a list of all layers in use in the tile, as well as the set of
additional layers provided, the total sorted by layer priority.
|
java.util.Map<Layer,java.lang.Integer> |
getLayersAt(int x,
int y)
Gets all layers that are set at the specified location, along with their intensities or values.
|
int |
getLayerValue(Layer layer,
int x,
int y) |
int |
getLowestRawHeight() |
int |
getRawHeight(int x,
int y)
Get the raw height value.
|
int[] |
getRawHeightRange() |
java.util.HashSet<Seed> |
getSeeds() |
float |
getSlope(int x,
int y) |
Terrain |
getTerrain(int x,
int y) |
int |
getWaterLevel(int x,
int y) |
boolean |
hasLayer(Layer layer) |
boolean |
repair(int minHeight,
int maxHeight,
java.io.PrintStream out) |
java.lang.String |
toString() |
addListener, bufferChanged, clearLayerData, clearLayerData, ensureReadable, inhibitEvents, isEventsInhibited, plantSeed, redoPerformed, register, releaseEvents, removeListener, removeSeed, savePointArmed, savePointCreated, setBitLayerValue, setHeight, setLayerValue, setMinMaxHeight, setRawHeight, setTerrain, setWaterLevel, transform, undoPerformed, unregister
doGetLayers, doGetSlope, equals, getHighestHeight, getHighestIntHeight, getLowestHeight, getLowestIntHeight, getMaxHeight, getMinHeight, getX, getY, hashCode
setInstantiationListener
protected final Tile tile
public RODelegatingTile(Tile tile)
public int getFloodedCount(int x, int y, int r, boolean lava)
Tile
getFloodedCount
in class Tile
x
- The X coordinate (local to the tile) of the location around
which to count flooded blocks.y
- The Y coordinate (local to the tile) of the location around
which to count flooded blocks.r
- The radius of the square.lava
- Whether to check for lava (when true
) or water
(when false
).public java.util.List<Layer> getActiveLayers(int x, int y)
getActiveLayers
in class Tile
public int getIntHeight(int x, int y)
getIntHeight
in class Tile
public int getRawHeight(int x, int y)
Tile
minHeight
.getRawHeight
in class Tile
public int getLowestRawHeight()
getLowestRawHeight
in class Tile
public int getHighestRawHeight()
getHighestRawHeight
in class Tile
public int[] getRawHeightRange()
getRawHeightRange
in class Tile
public Terrain getTerrain(int x, int y)
getTerrain
in class Tile
public java.util.Set<Terrain> getAllTerrains()
getAllTerrains
in class Tile
public int getWaterLevel(int x, int y)
getWaterLevel
in class Tile
public int getHighestWaterLevel()
getHighestWaterLevel
in class Tile
public boolean containsOneOf(Layer... layers)
containsOneOf
in class Tile
public java.util.List<Layer> getLayers(java.util.Set<Layer> additionalLayers)
Tile
public boolean getBitLayerValue(Layer layer, int x, int y)
getBitLayerValue
in class Tile
public int getBitLayerCount(Layer layer, int x, int y, int r)
Tile
getBitLayerCount
in class Tile
layer
- The bit layer to count.x
- The X coordinate (local to the tile) of the location around
which to count the layer.y
- The Y coordinate (local to the tile) of the location around
which to count the layer.r
- The radius of the square.public java.util.Map<Layer,java.lang.Integer> getLayersAt(int x, int y)
Tile
getLayersAt
in class Tile
x
- The X location for which to retrieve all layers.y
- The Y location for which to retrieve all layers.null
or an empty map if no layers are present.public float getDistanceToEdge(Layer layer, int x, int y, float maxDistance)
getDistanceToEdge
in class Tile
public int getLayerValue(Layer layer, int x, int y)
getLayerValue
in class Tile
public boolean repair(int minHeight, int maxHeight, java.io.PrintStream out)
repair
in class ReadOnlyTile
public java.lang.String toString()
toString
in class ReadOnlyTile