#pragma once #include "../Common/Sizes.hpp" #include namespace MC::World { class BlockType { public: enum Value : U8 { Air, Dirt, Grass, Stone, Sand, Snow, Wood, Leaves, Water, }; static constexpr U8 Size = Water + 1; BlockType() : m_block(Air) {} BlockType(Value block) : m_block(block) {} operator Value() const { return m_block; } Bool is_transparent() const { switch (m_block) { case Air: case Leaves: return true; default: return false; } } static std::vector all() { return { Air, Dirt, Grass, Stone, Sand, Snow, Wood, Leaves, Water, }; } private: Value m_block; }; }