style: apply code-style cleanup (explicit types, this-qualification, switch expressions)

This commit is contained in:
2026-05-28 13:29:13 +02:00
parent 8e3195ca37
commit 70c986529b
9 changed files with 110 additions and 102 deletions

View File

@@ -4,16 +4,16 @@ public sealed class Chunk
{
public const int Size = 16;
private readonly ushort[] _ids = new ushort[Size * Size * Size];
private readonly ushort[] _ids = new ushort[Chunk.Size * Chunk.Size * Chunk.Size];
public ushort this[int x, int y, int z]
{
get => _ids[Index(x, y, z)];
set => _ids[Index(x, y, z)] = value;
get => this._ids[Chunk.Index(x, y, z)];
set => this._ids[Chunk.Index(x, y, z)] = value;
}
public static bool InBounds(int x, int y, int z) =>
x >= 0 && x < Size && y >= 0 && y < Size && z >= 0 && z < Size;
x is >= 0 and < Chunk.Size && y is >= 0 and < Chunk.Size && z is >= 0 and < Chunk.Size;
private static int Index(int x, int y, int z) => (x * Size + y) * Size + z;
private static int Index(int x, int y, int z) => (x * Chunk.Size + y) * Chunk.Size + z;
}