summaryrefslogtreecommitdiff
path: root/src/mapgen_math.h
diff options
context:
space:
mode:
authorkwolekr <kwolekr@minetest.net>2014-02-03 22:42:10 -0500
committerkwolekr <kwolekr@minetest.net>2014-02-03 22:50:14 -0500
commit5a34f40d80ea1a339b599bc11db549a6bd86912f (patch)
tree07ead9e3ff4732479af41b739a26b5dc8182c5fd /src/mapgen_math.h
parenta439343844cf821e4922e23f1638b92e2cfb14ac (diff)
downloadminetest-5a34f40d80ea1a339b599bc11db549a6bd86912f.tar.gz
minetest-5a34f40d80ea1a339b599bc11db549a6bd86912f.tar.bz2
minetest-5a34f40d80ea1a339b599bc11db549a6bd86912f.zip
Huge overhaul of the entire MapgenParams system
MapgenParams is no longer a polymorphic class, eliminating the need for messy and bug-prone reallocations. Separation between the common and mapgen-specific parameters is now strongly defined. Mapgen parameters objects are now properly encapsulated within the proper subsystems.
Diffstat (limited to 'src/mapgen_math.h')
-rw-r--r--src/mapgen_math.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/mapgen_math.h b/src/mapgen_math.h
index 1bc404641..304a337c4 100644
--- a/src/mapgen_math.h
+++ b/src/mapgen_math.h
@@ -26,12 +26,12 @@ with this program; if not, write to the Free Software Foundation, Inc.,
struct MapgenMathParams : public MapgenV7Params {
- MapgenMathParams() {
- }
+ MapgenMathParams() {}
+ ~MapgenMathParams() {}
Json::Value params;
- bool readParams(Settings *settings);
+ void readParams(Settings *settings);
void writeParams(Settings *settings);
};
@@ -39,7 +39,7 @@ class MapgenMath : public MapgenV7 {
public:
MapgenMathParams * mg_params;
- MapgenMath(int mapgenid, MapgenMathParams *mg_params, EmergeManager *emerge);
+ MapgenMath(int mapgenid, MapgenParams *mg_params, EmergeManager *emerge);
~MapgenMath();
int generateTerrain();
@@ -57,10 +57,10 @@ class MapgenMath : public MapgenV7 {
struct MapgenFactoryMath : public MapgenFactory {
Mapgen *createMapgen(int mgid, MapgenParams *params, EmergeManager *emerge) {
- return new MapgenMath(mgid, (MapgenMathParams *)params, emerge);
+ return new MapgenMath(mgid, params, emerge);
};
- MapgenParams *createMapgenParams() {
+ MapgenSpecificParams *createMapgenParams() {
return new MapgenMathParams();
};
};