#include "Chunk.hpp" #include "BlockSide.hpp" namespace MC::World { const Chunk::BlockData& Chunk::at(U32 x, U32 y, U32 z) const { return m_blocks.at(pos(x, y, z)); } Chunk::BlockData& Chunk::at(U32 x, U32 y, U32 z) { return m_blocks.at(pos(x, y, z)); } Bool Chunk::is_empty(U32 x, U32 y, U32 z) const { return at(x, y, z).empty(); } Vector<3> Chunk::position() const { return m_position; } Bool Chunk::is_valid_position(U32 x, U32 y, U32 z) { return x < Width && y < Height && z < Width; } U64 Chunk::pos(U32 x, U32 y, U32 z) { return x + Width * y + Width * Height * z; } }