Removed made public variables private in JoystickManager and KeyboardManager
[supertux.git] / src / supertux / sector.hpp
index 595d857..71232d7 100644 (file)
@@ -27,6 +27,7 @@
 #include "util/writer_fwd.hpp"
 #include "util/currenton.hpp"
 #include "video/color.hpp"
+#include "object/anchor_point.hpp"
 
 namespace collision {
 class Constraints;
@@ -74,7 +75,7 @@ public:
   /// read sector from lisp file
   void parse(const Reader& lisp);
   void parse_old_format(const Reader& lisp);
-  
+
   /// activates this sector (change music, initialize player class, ...)
   void activate(const std::string& spawnpoint);
   void activate(const Vector& player_pos);
@@ -94,8 +95,8 @@ public:
   /// adds a gameobject
   void add_object(GameObject* object);
 
-  void set_name(const std::string& name)
-  { this->name = name; }
+  void set_name(const std::string& name_)
+  { this->name = name_; }
   const std::string& get_name() const
   { return name; }
 
@@ -129,7 +130,8 @@ public:
   }
 
   void collision_tilemap(collision::Constraints* constraints,
-                         const Vector& movement, const Rectf& dest) const;
+                         const Vector& movement, const Rectf& dest,
+                         MovingObject &object) const;
 
   /**
    * Checks if the specified rectangle is free of (solid) tiles.
@@ -157,6 +159,13 @@ public:
   std::vector<Player*> get_players() {
     return std::vector<Player*>(1, this->player);
   }
+  Player *get_nearest_player (const Vector& pos);
+  Player *get_nearest_player (const Rectf& pos)
+  {
+    return (get_nearest_player (get_anchor_pos (pos, ANCHOR_MIDDLE)));
+  }
+
+  std::vector<MovingObject*> get_nearby_objects (const Vector& center, float max_distance);
 
   Rectf get_active_region();
 
@@ -227,7 +236,7 @@ private:
    * (because of ABORT_MOVE in the collision response or no collisions)
    */
   void collision_static(collision::Constraints* constraints,
-                        const Vector& movement, const Rectf& dest, GameObject& object);
+                        const Vector& movement, const Rectf& dest, MovingObject& object);
 
   void collision_static_constrains(MovingObject& object);