aboutsummaryrefslogtreecommitdiff
path: root/src/mapgen_fractal.h
diff options
context:
space:
mode:
authorkwolekr <kwolekr@minetest.net>2016-06-14 00:10:55 -0400
committerkwolekr <kwolekr@minetest.net>2016-07-03 14:04:11 -0400
commit92705306bfb4994107a43514f29997cea15d48dc (patch)
treed1919cc2b5091ef6e31cdd312f5cd92ba058e76e /src/mapgen_fractal.h
parent70e2c1c7d413d20757f571e3f1e02b05c95418f1 (diff)
downloadminetest-92705306bfb4994107a43514f29997cea15d48dc.tar.gz
minetest-92705306bfb4994107a43514f29997cea15d48dc.tar.bz2
minetest-92705306bfb4994107a43514f29997cea15d48dc.zip
Mapgen: Refactor mapgen creation and management
- Move mapgen creation logic out of EmergeManager and into Mapgen - Internally represent mapgen type as an enum value, instead of a string - Remove the need for a MapgenFactory per mapgen
Diffstat (limited to 'src/mapgen_fractal.h')
-rw-r--r--src/mapgen_fractal.h14
1 files changed, 2 insertions, 12 deletions
diff --git a/src/mapgen_fractal.h b/src/mapgen_fractal.h
index 065142b84..cbd5567c4 100644
--- a/src/mapgen_fractal.h
+++ b/src/mapgen_fractal.h
@@ -62,6 +62,8 @@ public:
MapgenFractal(int mapgenid, MapgenParams *params, EmergeManager *emerge);
~MapgenFractal();
+ virtual MapgenType getType() const { return MAPGEN_FRACTAL; }
+
virtual void makeChunk(BlockMakeData *data);
int getSpawnLevelAtPoint(v2s16 p);
bool getFractalAtPoint(s16 x, s16 y, s16 z);
@@ -83,16 +85,4 @@ private:
Noise *noise_seabed;
};
-struct MapgenFactoryFractal : public MapgenFactory {
- Mapgen *createMapgen(int mgid, MapgenParams *params, EmergeManager *emerge)
- {
- return new MapgenFractal(mgid, params, emerge);
- };
-
- MapgenSpecificParams *createMapgenParams()
- {
- return new MapgenFractalParams();
- };
-};
-
#endif