aboutsummaryrefslogtreecommitdiff
path: root/src/mapgen/mg_decoration.h
diff options
context:
space:
mode:
authorsfan5 <sfan5@live.de>2020-04-09 23:40:12 +0200
committerLoïc Blot <nerzhul@users.noreply.github.com>2020-05-05 19:26:59 +0200
commit2062c80e21b657fed8e68aa48523fa12ad5ef095 (patch)
tree4e760f58a01ddcf55593bed8abcbf41d11f1c96b /src/mapgen/mg_decoration.h
parentd1c6cc72cce7e02dcaca7797b463d071d67d27db (diff)
downloadminetest-2062c80e21b657fed8e68aa48523fa12ad5ef095.tar.gz
minetest-2062c80e21b657fed8e68aa48523fa12ad5ef095.tar.bz2
minetest-2062c80e21b657fed8e68aa48523fa12ad5ef095.zip
Allow ObjDefManager instances to be cloned
Diffstat (limited to 'src/mapgen/mg_decoration.h')
-rw-r--r--src/mapgen/mg_decoration.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/mapgen/mg_decoration.h b/src/mapgen/mg_decoration.h
index 03fec04fd..af8fcd7bf 100644
--- a/src/mapgen/mg_decoration.h
+++ b/src/mapgen/mg_decoration.h
@@ -73,11 +73,16 @@ public:
s16 place_offset_y = 0;
std::unordered_set<u8> biomes;
+
+protected:
+ void cloneTo(Decoration *def) const;
};
class DecoSimple : public Decoration {
public:
+ ObjDef *clone() const;
+
virtual void resolveNodeNames();
virtual size_t generate(MMVManip *vm, PcgRandom *pr, v3s16 p, bool ceiling);
@@ -91,6 +96,8 @@ public:
class DecoSchematic : public Decoration {
public:
+ ObjDef *clone() const;
+
DecoSchematic() = default;
virtual size_t generate(MMVManip *vm, PcgRandom *pr, v3s16 p, bool ceiling);
@@ -113,6 +120,8 @@ public:
DecorationManager(IGameDef *gamedef);
virtual ~DecorationManager() = default;
+ DecorationManager *clone() const;
+
const char *getObjectTitle() const
{
return "decoration";
@@ -133,4 +142,7 @@ public:
}
size_t placeAllDecos(Mapgen *mg, u32 blockseed, v3s16 nmin, v3s16 nmax);
+
+private:
+ DecorationManager() {};
};