summary refs log tree commit diff
path: root/src/World/BiomeType.hpp
blob: 2e3d8c61d680e3075949d3237ca8f3096eeb22f0 (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 BiomeType {
public:
    enum Value : uint8_t {
        Plains,
        Forest,
        Alpine,
        Desert,
        Jungle,
        Beach,
        River,
        Ocean,
    };

    static constexpr uint8_t Size = Ocean + 1;

    BiomeType() : m_biome(Plains) {}
    BiomeType(const Value biome) : m_biome(biome) {}

    operator Value() const { return m_biome; }

    static std::vector<BiomeType> all() {
        return { Plains, Forest, Alpine, Desert, Jungle, Beach, River, Ocean };
    }

    static std::vector<BiomeType> all_ground() {
        return { Plains, Forest, Alpine, Desert, Jungle, Beach };
    }

private:
    Value m_biome;
};

}