summaryrefslogtreecommitdiff
path: root/src/mg_biome.h
diff options
context:
space:
mode:
authorkwolekr <kwolekr@minetest.net>2014-11-12 23:01:13 -0500
committerkwolekr <kwolekr@minetest.net>2014-11-12 23:02:41 -0500
commit7616537bc071bc93f8d36c84b94603528be1efb0 (patch)
tree487185069e4f39f1f828a831b1d1ba9c88ed4298 /src/mg_biome.h
parentf25cc0dbae0209f2647ac5eec9fe6ddb08174f55 (diff)
downloadminetest-7616537bc071bc93f8d36c84b94603528be1efb0.tar.gz
minetest-7616537bc071bc93f8d36c84b94603528be1efb0.tar.bz2
minetest-7616537bc071bc93f8d36c84b94603528be1efb0.zip
Add Generator Element Management framework
Add BiomeManager, OreManager, DecorationManager, and SchematicManager
Diffstat (limited to 'src/mg_biome.h')
-rw-r--r--src/mg_biome.h54
1 files changed, 26 insertions, 28 deletions
diff --git a/src/mg_biome.h b/src/mg_biome.h
index 3724652bd..9c653a768 100644
--- a/src/mg_biome.h
+++ b/src/mg_biome.h
@@ -20,12 +20,13 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#ifndef MG_BIOME_HEADER
#define MG_BIOME_HEADER
-#include <string>
-#include "nodedef.h"
-#include "gamedef.h"
-#include "mapnode.h"
-#include "noise.h"
#include "mapgen.h"
+#include "noise.h"
+
+//#include <string>
+//#include "nodedef.h"
+//#include "gamedef.h"
+//#include "mapnode.h"
enum BiomeTerrainType
{
@@ -39,10 +40,16 @@ enum BiomeTerrainType
extern NoiseParams nparams_biome_def_heat;
extern NoiseParams nparams_biome_def_humidity;
-class Biome {
+
+struct BiomeNoiseInput {
+ v2s16 mapsize;
+ float *heat_map;
+ float *humidity_map;
+ s16 *height_map;
+};
+
+class Biome : public GenElement {
public:
- u8 id;
- std::string name;
u32 flags;
content_t c_top;
@@ -60,33 +67,24 @@ public:
float humidity_point;
};
-struct BiomeNoiseInput {
- v2s16 mapsize;
- float *heat_map;
- float *humidity_map;
- s16 *height_map;
-};
-
-class BiomeDefManager {
+class BiomeManager : public GenElementManager {
public:
- std::vector<Biome *> biomes;
+ static const char *ELEMENT_TITLE;
+ static const size_t ELEMENT_LIMIT = 0x100;
- bool biome_registration_finished;
NoiseParams *np_heat;
NoiseParams *np_humidity;
- BiomeDefManager(NodeResolver *resolver);
- ~BiomeDefManager();
+ BiomeManager(IGameDef *gamedef);
+ ~BiomeManager();
- Biome *createBiome(BiomeTerrainType btt);
- void calcBiomes(BiomeNoiseInput *input, u8 *biomeid_map);
- Biome *getBiome(float heat, float humidity, s16 y);
+ Biome *create(int btt)
+ {
+ return new Biome;
+ }
- bool addBiome(Biome *b);
- u8 getBiomeIdByName(const char *name);
-
- s16 calcBlockHeat(v3s16 p, u64 seed, float timeofday, float totaltime);
- s16 calcBlockHumidity(v3s16 p, u64 seed, float timeofday, float totaltime);
+ void calcBiomes(BiomeNoiseInput *input, u8 *biomeid_map);
+ Biome *getBiome(float heat, float humidity, s16 y);
};
#endif