diff options
Diffstat (limited to 'src/World/BlockType.hpp')
| -rw-r--r-- | src/World/BlockType.hpp | 39 |
1 files changed, 34 insertions, 5 deletions
diff --git a/src/World/BlockType.hpp b/src/World/BlockType.hpp index 8d83be0..65afe0d 100644 --- a/src/World/BlockType.hpp +++ b/src/World/BlockType.hpp @@ -1,11 +1,40 @@ -#pragma +#pragma once + +#include <cstdint> +#include <vector> namespace MC::World { -enum class BlockType : uint8_t { - Air, - Dirt, - Grass, +class BlockType { +public: + enum Value : uint8_t { + Air, + Dirt, + Grass, + Stone, + Sand, + Water, + }; + + static constexpr const size_t Size = 6; + + BlockType() = default; + BlockType(Value block) : m_block(block) {} + + operator Value() const { return m_block; } + + static std::vector<BlockType> all() { + return { + Air, + Dirt, + Grass, + Stone, + Sand, + Water, + }; + } +private: + Value m_block; }; } \ No newline at end of file |
