diff options
Diffstat (limited to 'src/World/Chunk.hpp')
| -rw-r--r-- | src/World/Chunk.hpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/World/Chunk.hpp b/src/World/Chunk.hpp index 32d3ab3..1aa2dd1 100644 --- a/src/World/Chunk.hpp +++ b/src/World/Chunk.hpp @@ -21,8 +21,8 @@ public: m_position{(Real)x * Width, 0.0f, (Real)y * Width} {} struct BlockData { - BlockData() : type(BlockType::Air) {} - BlockData(BlockType t) : type(t), light{} {} + BlockData() : type(BlockType::Air), light{200} {} + BlockData(BlockType t) : type(t), light{200} {} BlockType type; U8 light; @@ -52,6 +52,9 @@ public: ChunkIndex index() const; Vector<3> position() const; + Bool is_damaged() const; + void damage(); + static Bool is_valid_position(U32 x, U32 y, U32 z); private: static U64 pos(U32 x, U32 y, U32 z); @@ -60,6 +63,8 @@ private: Vector<3> m_position; std::vector<BlockData> m_blocks; + Bool m_damaged = false; + Details m_details; }; |
