From fe2baedc760c2f29e2c720f6b1132a2de33c5430 Mon Sep 17 00:00:00 2001 From: Mel Date: Sat, 8 Jul 2023 03:25:44 +0200 Subject: Use own size types --- src/World/Chunk.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/World/Chunk.cpp') diff --git a/src/World/Chunk.cpp b/src/World/Chunk.cpp index 079575a..94e757e 100644 --- a/src/World/Chunk.cpp +++ b/src/World/Chunk.cpp @@ -3,15 +3,15 @@ namespace MC::World { -void Chunk::set(uint32_t x, uint32_t y, uint32_t z, BlockData data) { +void Chunk::set(U32 x, U32 y, U32 z, BlockData data) { m_blocks.at(pos(x, y, z)) = data; } -Chunk::BlockData Chunk::get(uint32_t x, uint32_t y, uint32_t z) const { +Chunk::BlockData Chunk::get(U32 x, U32 y, U32 z) const { return m_blocks.at(pos(x, y, z)); } -bool Chunk::is_empty(uint32_t x, uint32_t y, uint32_t z) const { +Bool Chunk::is_empty(U32 x, U32 y, U32 z) const { return get(x, y, z).empty(); } @@ -19,11 +19,11 @@ Vector<3> Chunk::position() const { return m_position; } -bool Chunk::is_valid_position(uint32_t x, uint32_t y, uint32_t z) { +Bool Chunk::is_valid_position(U32 x, U32 y, U32 z) { return x < Width && y < Height && z < Width; } -uint64_t Chunk::pos(uint32_t x, uint32_t y, uint32_t z) { +U64 Chunk::pos(U32 x, U32 y, U32 z) { return x + Width * y + Width * Height * z; } -- cgit 1.4.1