]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/biome.h
Limit speed in collisionMoveResult for avoiding hangs
[dragonfireclient.git] / src / biome.h
index 5e43ab6d758f61f70a70925654c423042abd3477..c30af46ad821302ce742e141cda9d6c952173b7b 100644 (file)
@@ -1,6 +1,6 @@
 /*
-Minetest-c55
-Copyright (C) 2010-2011 kwolekr, Ryan Kwolek <kwolekr2@cs.scranton.edu>
+Minetest
+Copyright (C) 2010-2013 kwolekr, Ryan Kwolek <kwolekr2@cs.scranton.edu>
 
 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU Lesser General Public License as published by
@@ -20,32 +20,44 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #ifndef BIOME_HEADER
 #define BIOME_HEADER
 
+#include <string>
 #include "nodedef.h"
 #include "gamedef.h"
 #include "mapnode.h"
 #include "noise.h"
 #include "mapgen.h"
 
+
+enum BiomeTerrainType
+{
+       BIOME_TERRAIN_NORMAL,
+       BIOME_TERRAIN_LIQUID,
+       BIOME_TERRAIN_NETHER,
+       BIOME_TERRAIN_AETHER,
+       BIOME_TERRAIN_FLAT
+};
+
 class Biome {
 public:
        MapNode n_top;
        MapNode n_filler;
        s16 ntopnodes;
-       s16 flags;
+       s8 groupid;
+       s8 flags;
        s16 height_min;
        s16 height_max;
        float heat_min;
        float heat_max;
        float humidity_min;
        float humidity_max;
-       const char *name;
+       std::string name;
        NoiseParams *np;
 
        virtual void genColumn(Mapgen *mg, int x, int z, int y1, int y2);
        virtual int getSurfaceHeight(float noise_terrain);
 };
 
-class BiomeOcean : public Biome {
+class BiomeLiquid : public Biome {
        virtual void genColumn(Mapgen *mg, int x, int z, int y1, int y2);
 };
 
@@ -54,6 +66,11 @@ class BiomeHell : public Biome {
        virtual int getSurfaceHeight(float noise_terrain);
 };
 
+class BiomeAether : public Biome {
+       virtual void genColumn(Mapgen *mg, int x, int z, int y1, int y2);
+       virtual int getSurfaceHeight(float noise_terrain);
+};
+
 class BiomeSuperflat : public Biome {
        virtual void genColumn(Mapgen *mg, int x, int z, int y1, int y2);
        virtual int getSurfaceHeight(float noise_terrain);
@@ -70,9 +87,11 @@ class BiomeDefManager {
        BiomeDefManager(IGameDef *gamedef);
        ~BiomeDefManager();
 
+       Biome *createBiome(BiomeTerrainType btt);
        Biome *getBiome(float bgfreq, float heat, float humidity);
 
-       void addBiome();
+       void addBiomeGroup(float freq);
+       void addBiome(Biome *b);
        void addDefaultBiomes();
 };