Statisticts now also count secret areas found
[supertux.git] / src / sector.hpp
index 12a1682..d291c0a 100644 (file)
@@ -28,7 +28,6 @@
 #include "script_manager.hpp"
 #include "math/vector.hpp"
 #include "video/drawing_context.hpp"
-#include "level.hpp"
 
 namespace lisp {
 class Lisp;
@@ -47,6 +46,7 @@ class ScriptInterpreter;
 class SpawnPoint;
 class MovingObject;
 class CollisionHit;
+class Level;
 
 enum MusicType {
   LEVEL_MUSIC,
@@ -117,6 +117,16 @@ public:
   /** Get total number of badguys */
   int get_total_badguys();
 
+  /** Get total number of GameObjects of given type */
+  template<class T> int get_total_count()
+  {
+    int total = 0;
+    for(GameObjects::iterator i = gameobjects.begin(); i != gameobjects.end(); ++i) {
+      if (dynamic_cast<T*>(*i)) total++;
+    }
+    return total;
+  }
+
   void collision_tilemap(const Rect& dest, const Vector& movement, CollisionHit& hit) const;
 
   /** Checks if at the specified rectangle are gameobjects with STATIC flag set