Class ChunkCellStorage
Provides safe indexed access over the fixed-size cell array owned by a chunk.
public sealed class ChunkCellStorage
- Inheritance
-
ChunkCellStorage
- Inherited Members
Constructors
ChunkCellStorage()
Creates an empty fixed-size chunk cell buffer.
public ChunkCellStorage()
Properties
Count
Gets the total number of cells stored by the buffer.
public int Count { get; }
Property Value
Methods
GetCell(int, int)
Reads a cell from local chunk coordinates.
public TileCell GetCell(int localX, int localY)
Parameters
Returns
- TileCell
The resolved cell value.
IsInside(int, int)
Returns whether the supplied local coordinate lies inside the chunk.
public bool IsInside(int localX, int localY)
Parameters
Returns
SetCell(int, int, TileCell)
Writes a cell to local chunk coordinates.
public void SetCell(int localX, int localY, TileCell cell)
Parameters
localXintThe local X coordinate.
localYintThe local Y coordinate.
cellTileCellThe cell value to store.
ToIndex(int, int)
Converts a local chunk coordinate into a row-major cell index.
public int ToIndex(int localX, int localY)
Parameters
Returns
- int
The row-major cell index.