diff options
Diffstat (limited to 'src/World/Chunk.hpp')
| -rw-r--r-- | src/World/Chunk.hpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/World/Chunk.hpp b/src/World/Chunk.hpp index bc44137..5f4844e 100644 --- a/src/World/Chunk.hpp +++ b/src/World/Chunk.hpp @@ -4,7 +4,6 @@ #include "BiomeType.hpp" #include "BlockType.hpp" #include "../GFX/Mesh.hpp" -#include "BlockSide.hpp" namespace MC::World { @@ -18,13 +17,18 @@ public: m_position{(Real)x * Width, 0.0f, (Real)y * Width} {} struct BlockData { + BlockData() : type(BlockType::Air) {} + BlockData(BlockType t) : type(t), light{} {} + BlockType type; + U8 light; Bool empty() const { return type == BlockType::Air; } }; - void set(U32 x, U32 y, U32 z, BlockData data); - BlockData get(U32 x, U32 y, U32 z) const; + const BlockData& at(U32 x, U32 y, U32 z) const; + BlockData& at(U32 x, U32 y, U32 z); + Bool is_empty(U32 x, U32 y, U32 z) const; struct Details { |
