Interface IChunkData
A 32x32x32 volume of int values representing block states.
public interface IChunkData
Fields
AxisLength
The size of a chunk along each axis, in blocks.
public const int AxisLength = 32
Field Value
BitsPerAxis
The number of bits needed to hold a chunk-relative block coordinate for a single axis.
public const int BitsPerAxis = 5
Field Value
Volume
The volume of a chunk, in blocks. This serves as the upper limit (exclusive) for block indices.
public const int Volume = 32768
Field Value
Properties
IsEmpty
Whether all values are zero.
bool IsEmpty { get; }
Property Value
this[BlockIndex]
Gets or sets a block's value by its index.
int this[BlockIndex i] { get; set; }
Parameters
Property Value
Exceptions
- IndexOutOfRangeException
If
iis < 0 or >= Volume.
Methods
Clear()
Resets all values to zero.
void Clear()
GetAndSet(BlockIndex, int)
Sets a block's value by its index and returns its previous value.
int GetAndSet(BlockIndex i, int value)
Parameters
iBlockIndexThe block's index.
valueintThe new value.
Returns
- int
The previous value.
Exceptions
- IndexOutOfRangeException
If
iis < 0 or >= Volume.