Use std::queue for HTTPFetchRequest and std::vector for log_output instead of std...
[oweals/minetest.git] / src / mg_decoration.h
index f360e3b76945cf84d69280296897f7d84d906d7f..ab4a9377b49361999f6dc9d77e8c4cea44f03e7b 100644 (file)
@@ -25,7 +25,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 
 struct NoiseParams;
 class Mapgen;
-class ManualMapVoxelManipulator;
+class MMVManip;
 class PseudoRandom;
 class Schematic;
 
@@ -58,7 +58,7 @@ struct CutoffData {
 };
 #endif
 
-class Decoration : public GenElement {
+class Decoration : public GenElement, public NodeResolver {
 public:
        INodeDefManager *ndef;
 
@@ -66,6 +66,8 @@ public:
        int mapseed;
        std::vector<content_t> c_place_on;
        s16 sidelen;
+       s16 y_min;
+       s16 y_max;
        float fill_ratio;
        NoiseParams np;
 
@@ -76,10 +78,12 @@ public:
        Decoration();
        virtual ~Decoration();
 
+       virtual void resolveNodeNames(NodeResolveInfo *nri);
+
        size_t placeDeco(Mapgen *mg, u32 blockseed, v3s16 nmin, v3s16 nmax);
-       size_t placeCutoffs(Mapgen *mg, u32 blockseed, v3s16 nmin, v3s16 nmax);
+       //size_t placeCutoffs(Mapgen *mg, u32 blockseed, v3s16 nmin, v3s16 nmax);
 
-       virtual size_t generate(Mapgen *mg, PseudoRandom *pr, s16 max_y, v3s16 p) = 0;
+       virtual size_t generate(MMVManip *vm, PseudoRandom *pr, s16 max_y, v3s16 p) = 0;
        virtual int getHeight() = 0;
 };
 
@@ -91,10 +95,10 @@ public:
        s16 deco_height_max;
        s16 nspawnby;
 
-       ~DecoSimple() {}
+       virtual void resolveNodeNames(NodeResolveInfo *nri);
 
-       bool canPlaceDecoration(ManualMapVoxelManipulator *vm, v3s16 p);
-       virtual size_t generate(Mapgen *mg, PseudoRandom *pr, s16 max_y, v3s16 p);
+       bool canPlaceDecoration(MMVManip *vm, v3s16 p);
+       virtual size_t generate(MMVManip *vm, PseudoRandom *pr, s16 max_y, v3s16 p);
        virtual int getHeight();
 };
 
@@ -104,9 +108,7 @@ public:
        Schematic *schematic;
        std::string filename;
 
-       ~DecoSchematic() {}
-
-       virtual size_t generate(Mapgen *mg, PseudoRandom *pr, s16 max_y, v3s16 p);
+       virtual size_t generate(MMVManip *vm, PseudoRandom *pr, s16 max_y, v3s16 p);
        virtual int getHeight();
 };
 
@@ -123,7 +125,7 @@ public:
        static const char *ELEMENT_TITLE;
        static const size_t ELEMENT_LIMIT = 0x10000;
 
-       DecorationManager(IGameDef *gamedef) {}
+       DecorationManager(IGameDef *gamedef);
        ~DecorationManager() {}
 
        Decoration *create(int type)
@@ -140,7 +142,9 @@ public:
                }
        }
 
-       size_t placeAllDecos(Mapgen *mg, u32 seed, v3s16 nmin, v3s16 nmax);
+       void clear();
+
+       size_t placeAllDecos(Mapgen *mg, u32 blockseed, v3s16 nmin, v3s16 nmax);
 };
 
 #endif