X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Fmg_biome.h;h=f45238f28f6dd9d90933f8242467b06eb93b62e1;hb=179476d8330ff0fd03c3c95bbb8ea0f55e5ad2ed;hp=2e07fd9cfad1a00fe3da87b4724b6dbea66bee59;hpb=210a339dce754a6cb03d4ef82f5bacc80b63262b;p=minetest.git diff --git a/src/mg_biome.h b/src/mg_biome.h index 2e07fd9cf..f45238f28 100644 --- a/src/mg_biome.h +++ b/src/mg_biome.h @@ -18,8 +18,7 @@ with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef MG_BIOME_HEADER -#define MG_BIOME_HEADER +#pragma once #include "objdef.h" #include "nodedef.h" @@ -84,14 +83,15 @@ enum BiomeGenType { struct BiomeParams { virtual void readParams(const Settings *settings) = 0; virtual void writeParams(Settings *settings) const = 0; - virtual ~BiomeParams() {} + virtual ~BiomeParams() = default; s32 seed; }; class BiomeGen { public: - virtual ~BiomeGen() {} + virtual ~BiomeGen() = default; + virtual BiomeGenType getType() const = 0; // Calculates the biome at the exact position provided. This function can @@ -117,10 +117,10 @@ class BiomeGen { virtual Biome *getBiomeAtIndex(size_t index, s16 y) const = 0; // Result of calcBiomes bulk computation. - biome_t *biomemap; + biome_t *biomemap = nullptr; protected: - BiomeManager *m_bmgr; + BiomeManager *m_bmgr = nullptr; v3s16 m_pmin; v3s16 m_csize; }; @@ -189,7 +189,7 @@ class BiomeGenOriginal : public BiomeGen { class BiomeManager : public ObjDefManager { public: BiomeManager(Server *server); - virtual ~BiomeManager(); + virtual ~BiomeManager() = default; const char *getObjectTitle() const { @@ -228,6 +228,3 @@ class BiomeManager : public ObjDefManager { Server *m_server; }; - - -#endif