Cleanup in content_mapblock (#5746)
[oweals/minetest.git] / src / environment.h
index 14a18421bc0b4f11a493bdb8bc6132ad1aa23c04..1de13e9eddae8628f79730a694650e4f78fbdeb1 100644 (file)
@@ -36,24 +36,18 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "irr_v3d.h"
 #include "activeobject.h"
 #include "util/numeric.h"
-#include "mapnode.h"
-#include "mapblock.h"
 #include "threading/mutex.h"
 #include "threading/atomic.h"
 #include "network/networkprotocol.h" // for AccessDeniedCode
 
-class ITextureSource;
 class IGameDef;
 class Map;
-class GameScripting;
-class Player;
-class PointedThing;
 
 class Environment
 {
 public:
        // Environment will delete the map passed to the constructor
-       Environment();
+       Environment(IGameDef *gamedef);
        virtual ~Environment();
 
        /*
@@ -64,7 +58,7 @@ public:
        */
        virtual void step(f32 dtime) = 0;
 
-       virtual Map & getMap() = 0;
+       virtual Map &getMap() = 0;
 
        u32 getDayNightRatio();
 
@@ -84,6 +78,7 @@ public:
        // counter used internally when triggering ABMs
        u32 m_added_objects;
 
+       IGameDef *getGameDef() { return m_gamedef; }
 protected:
        GenericAtomic<float> m_time_of_day_speed;
 
@@ -121,6 +116,8 @@ protected:
        float m_cache_abm_interval;
        float m_cache_nodetimer_interval;
 
+       IGameDef *m_gamedef;
+
 private:
        Mutex m_time_lock;
 
@@ -128,4 +125,3 @@ private:
 };
 
 #endif
-