Skip to main content

MapChunkLayer

A class in Root.Township, Alta.Caves.

A 3D grid of float values for one cave generator plugin over one map chunk, with an overflow border around the chunk on the horizontal axes. Plugin parts read and write it with the indexer.

Constructors​

MemberWhat it is
MapChunkLayer(MapChunk chunk, PluginInstance plugin)Creates a MapChunkLayer from chunk and plugin.

Fields​

2 private and internal fields
MemberWhat it is
private bool isNonZeroListCreatedCopied from the plugin. When false, CreateAllNonZeroList returns null.
private float[,,] valuesThe layer's grid of values, padded by LayerOverflowXZ on X and Z. The indexer applies the offset.

Properties​

MemberWhat it is
MapChunk Chunk { get; }The map chunk the layer belongs to.
float this[int x, int y, int z] { get; set; }Value at x, y, z. X and z can go from MinXZ to MaxXZ (into the overflow border).
int LayerOverflowXZ { get; }Width of the extra border around the chunk, from the plugin settings.
int MaxXZ { get; }Exclusive upper bound for x and z: chunk size plus the overflow.
int MaxY { get; }Exclusive upper bound for y: the plugin's layer height.
int MinXZ { get; }Lowest x and z index: minus the overflow.
int MinY { get; }Lowest y index: 0.
List<MapChunkLayer.Value> NonZero { get; private set; }The list from the last CreateAllNonZeroList call.
PluginInstance Plugin { get; }The plugin instance that owns this layer.

Methods​

MemberWhat it is
List<MapChunkLayer.Value> CreateAllNonZeroList()Builds and stores the list of cells above 0, if the plugin asks for one. Returns null otherwise.
void Dispose()Drops the value grid.

Used in​

Members of other types that take, return or hold a MapChunkLayer: