Botcraft 1.21.4
Loading...
Searching...
No Matches
Biome.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <string>
4
5namespace Botcraft
6{
7 /// @brief Enum for biomes with special color processing
8 enum class BiomeType
9 {
10 Classic,
11 Swamp,
14#if PROTOCOL_VERSION >= 393 /* >= 1.13 */
15 WarmOcean ,
19#endif
20#if PROTOCOL_VERSION > 767 /* > 1.21.1 */
22#endif
23 };
24
25 class Biome
26 {
27 public:
28 Biome(const std::string& name_, const float temperature_,
29 const float rainfall_, const BiomeType biome_type_);
30 ~Biome();
31
32 const std::string& GetName() const;
33
34 // Height is the y value of the block
35 unsigned int GetColorMultiplier(const int height, const bool is_grass) const;
36 unsigned int GetWaterColorMultiplier() const;
37
38 private:
39 // Compute the value of the pixel in the triangle defined by the colors of the three corners
40 // height is 0 if y <= 64 and y - 64 otherwise
41 unsigned int ComputeColorTriangle(const int height, const bool is_grass) const;
42
43 private:
44 std::string name;
46 float rainfall;
47 unsigned int default_grass;
48 unsigned int default_leaves;
50 };
51} // Botcraft
unsigned int GetWaterColorMultiplier() const
Definition Biome.cpp:91
unsigned int default_grass
Definition Biome.hpp:47
BiomeType biome_type
Definition Biome.hpp:49
unsigned int GetColorMultiplier(const int height, const bool is_grass) const
Definition Biome.cpp:40
float rainfall
Definition Biome.hpp:46
unsigned int ComputeColorTriangle(const int height, const bool is_grass) const
Definition Biome.cpp:127
const std::string & GetName() const
Definition Biome.cpp:35
float temperature
Definition Biome.hpp:45
std::string name
Definition Biome.hpp:44
unsigned int default_leaves
Definition Biome.hpp:48
BiomeType
Enum for biomes with special color processing.
Definition Biome.hpp:9