diff options
| author | Mel <einebeere@gmail.com> | 2023-07-08 03:25:44 +0200 |
|---|---|---|
| committer | Mel <einebeere@gmail.com> | 2023-07-08 03:25:44 +0200 |
| commit | fe2baedc760c2f29e2c720f6b1132a2de33c5430 (patch) | |
| tree | dfbe1c72a17805a3cab6e0d47433e9021890c9ca /src/World/Chunk.cpp | |
| parent | 41fbca10f6c6cdd9c1623f1347e7ecb40f5e7f59 (diff) | |
| download | meowcraft-fe2baedc760c2f29e2c720f6b1132a2de33c5430.tar.zst meowcraft-fe2baedc760c2f29e2c720f6b1132a2de33c5430.zip | |
Use own size types
Diffstat (limited to 'src/World/Chunk.cpp')
| -rw-r--r-- | src/World/Chunk.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
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; } |
