Pure formatting from the IDE's code cleanup: remove redundant ClassName./namespace qualifiers and replace var with explicit types. No behavior change.
20 lines
533 B
C#
20 lines
533 B
C#
namespace VoxelEngine.World.Chunk;
|
|
|
|
public sealed class Chunk
|
|
{
|
|
public const int Size = 16;
|
|
|
|
private readonly ushort[] _ids = new ushort[Size * Size * Size];
|
|
|
|
public ushort this[int x, int y, int z]
|
|
{
|
|
get => this._ids[Index(x, y, z)];
|
|
set => this._ids[Index(x, y, z)] = value;
|
|
}
|
|
|
|
public static bool InBounds(int x, int y, int z) =>
|
|
x is >= 0 and < Size && y is >= 0 and < Size && z is >= 0 and < Size;
|
|
|
|
private static int Index(int x, int y, int z) => (x * Size + y) * Size + z;
|
|
}
|