- void collision_tilemap(MovingObject* object, CollisionHit& hit) const;
- uint32_t collision_tile_attributes(MovingObject* object) const;
+ /** 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
+ * (or solid tiles from the tilemap).
+ * This does not(!) include badguys or players.
+ */
+ bool is_free_space(const Rect& rect) const;
+
+ /**
+ * returns a list of players currently in the sector
+ */
+ std::vector<Player*> get_players() {
+ return std::vector<Player*>(1, this->player);
+ }
+
+ Rect get_active_region();
+
+ typedef std::vector<GameObject*> GameObjects;
+ typedef std::vector<MovingObject*> MovingObjects;
+ typedef std::vector<SpawnPoint*> SpawnPoints;