X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fsector.hpp;h=5bf497a05c8213b6b841b8c871cb8b75a8adc774;hb=02288dc76442bd6616a200a2d22c0954d2fc8180;hp=6d9e2f47e4a4573b43dce221b27089a7782e38ad;hpb=6ae2d154b976957d8e209bb991672b0c12c503c7;p=supertux.git diff --git a/src/sector.hpp b/src/sector.hpp index 6d9e2f47e..5bf497a05 100644 --- a/src/sector.hpp +++ b/src/sector.hpp @@ -87,11 +87,6 @@ public: void play_music(MusicType musictype); MusicType get_music_type(); - /** Checks for all possible collisions. And calls the - collision_handlers, which the collision_objects provide for this - case (or not). */ - void handle_collisions(); - bool add_bullet(const Vector& pos, float xm, Direction dir); bool add_smoke_cloud(const Vector& pos); void add_floating_text(const Vector& pos, const std::string& text); @@ -103,10 +98,30 @@ public: /** Get total number of badguys */ int get_total_badguys(); - void collision_tilemap(MovingObject* object, CollisionHit& hit) const; - uint32_t collision_tile_attributes(MovingObject* object) const; + 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) + */ + bool is_free_space(const Rect& rect) const; + + /** + * returns a list of players currently in the sector + */ + std::vector get_players() { + return std::vector(1, this->player); + } private: + uint32_t collision_tile_attributes(const Rect& dest) const; + + bool collision_static(MovingObject* object, const Vector& movement); + + /** Checks for all possible collisions. And calls the + collision_handlers, which the collision_objects provide for this + case (or not). */ + void handle_collisions(); + void collision_object(MovingObject* object1, MovingObject* object2) const; GameObject* parse_object(const std::string& name, const lisp::Lisp& lisp); @@ -115,7 +130,7 @@ private: std::string name; public: - std::string song_title; + std::string music; float gravity; // some special objects, where we need direct access