summary refs log tree commit diff
path: root/src/World/BlockType.hpp
diff options
context:
space:
mode:
authorMel <einebeere@gmail.com>2022-10-31 06:24:34 +0100
committerMel <einebeere@gmail.com>2022-10-31 06:24:34 +0100
commit23b0bc4d1ddc9fad3c32e8257497ddd13ac6a155 (patch)
tree16ac3e0fa2964f026c857daa4ff6f0ca11520d46 /src/World/BlockType.hpp
parent1b2b0069c9b7ad73c6cc6663b020d0fd894f4567 (diff)
downloadmeowcraft-23b0bc4d1ddc9fad3c32e8257497ddd13ac6a155.tar.zst
meowcraft-23b0bc4d1ddc9fad3c32e8257497ddd13ac6a155.zip
Proto biomes and new blocks
Diffstat (limited to 'src/World/BlockType.hpp')
-rw-r--r--src/World/BlockType.hpp39
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