Cuberite
A lightweight, fast and extensible game server for Minecraft
BiomeDef.h
Go to the documentation of this file.
1 
2 // BiomeDef.h
3 
4 // Defines relevant information and methods related to biomes
5 
6 
7 
8 
9 
10 #pragma once
11 
12 
13 
14 
15 
16 // tolua_begin
22 {
24 
26  biOcean = 0,
27  biPlains = 1,
28  biDesert = 2,
30  biForest = 4,
31  biTaiga = 5,
33  biRiver = 7,
34  biHell = 8, // same as Nether
35  biNether = 8,
36  biSky = 9, // same as biEnd
37  biEnd = 9,
41  biTundra = 12, // same as Ice Plains
45  biBeach = 16,
50  biJungle = 21,
52 
53  // Release 1.7 biomes:
66  biSavanna = 35,
68  biMesa = 37,
71 
72  // Automatically capture the maximum consecutive biome value into biMaxBiome:
73  biNumBiomes, // True number of biomes, since they are zero-based
74  biMaxBiome = biNumBiomes - 1, // The maximum biome value
75 
76  // Add this number to the biomes to get the variant
77  biVariant = 128,
78 
79  // Release 1.7 biome variants:
82  biDesertM = 130,
85  biTaigaM = 133,
86  biSwamplandM = 134,
88  biJungleM = 149,
93  biColdTaigaM = 158,
97  biSavannaM = 163,
99  biMesaBryce = 165,
102  // Automatically capture the maximum consecutive biome value into biVarientMaxBiome:
103  biNumVariantBiomes, // True number of biomes, since they are zero-based
104  biMaxVariantBiome = biNumVariantBiomes - 1, // The maximum biome value
105 } ;
106 
107 // tolua_end
108 
109 
110 
111 
112 
115 {
116 public:
117  std::size_t operator() (const EMCSBiome a_Biome) const
118  {
119  return static_cast<std::size_t>(a_Biome);
120  }
121 };
122 
123 
124 
125 
126 
127 // tolua_begin
128 
130 extern EMCSBiome StringToBiome(const AString & a_BiomeString);
131 
133 extern AString BiomeToString(int a_Biome);
134 
136 extern bool IsBiomeNoDownfall(EMCSBiome a_Biome);
137 
139 inline bool IsBiomeOcean(int a_Biome)
140 {
141  return ((a_Biome == biOcean) || (a_Biome == biDeepOcean));
142 }
143 
147 extern bool IsBiomeVeryCold(EMCSBiome a_Biome);
148 
152 extern bool IsBiomeCold(EMCSBiome a_Biome);
153 
155 extern int GetSnowStartHeight(EMCSBiome a_Biome);
156 
157 // tolua_end
bool IsBiomeCold(EMCSBiome a_Biome)
Returns true if the biome is cold (has snow and snowfall at higher elevations but not at regular heig...
Definition: BiomeDef.cpp:194
std::size_t operator()(const EMCSBiome a_Biome) const
Definition: BiomeDef.h:117
Hash for EMCSBiome, so that it can be used in std::unordered_map etc.
Definition: BiomeDef.h:114
EMCSBiome StringToBiome(const AString &a_BiomeString)
Translates a biome string to biome enum.
Definition: BiomeDef.cpp:92
Definition: BiomeDef.h:37
bool IsBiomeVeryCold(EMCSBiome a_Biome)
Returns true if the biome is very cold (has snow on ground everywhere, turns top water to ice...
Definition: BiomeDef.cpp:167
EMCSBiome
Biome IDs The first batch corresponds to the clientside biomes, used by MineCraft.
Definition: BiomeDef.h:21
AString BiomeToString(int a_Biome)
Translates biome enum into biome string.
Definition: BiomeDef.cpp:124
bool IsBiomeNoDownfall(EMCSBiome a_Biome)
Returns true if the biome has no downfall - deserts and savannas.
Definition: BiomeDef.cpp:140
std::string AString
Definition: StringUtils.h:13
bool IsBiomeOcean(int a_Biome)
Returns true if the biome is an ocean biome.
Definition: BiomeDef.h:139
Definition: BiomeDef.h:36
int GetSnowStartHeight(EMCSBiome a_Biome)
Returns the height when a biome when a biome starts snowing.
Definition: BiomeDef.cpp:226