summary refs log tree commit diff
path: root/src/World/BlockType.hpp
blob: 65afe0d0ecdeeaa129d64b31ac1fe5e2ff814f34 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#pragma once

#include <cstdint>
#include <vector>

namespace MC::World {

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;
};

}