|
supertux
|
Represents one of (potentially) multiple, separate parts of a Level. More...
#include <sector.hpp>
Public Member Functions | |
| Sector (Level &parent) | |
| void | finish_construction (bool editable) |
| Needs to be called after parsing to finish the construction of the Sector before using it. More... | |
| Level & | get_level () const |
| void | activate (const std::string &spawnpoint) |
| activates this sector (change music, initialize player class, ...) | |
| void | activate (const Vector &player_pos) |
| void | deactivate () |
| void | update (float dt_sec) |
| void | draw (DrawingContext &context) |
| void | save (Writer &writer) |
| void | stop_looping_sounds () |
| stops all looping sounds in whole sector. More... | |
| void | play_looping_sounds () |
| continues the looping sounds in whole sector. More... | |
| void | set_name (const std::string &name_) |
| const std::string & | get_name () const |
| bool | inside (const Rectf &rectangle) const |
| tests if a given rectangle is inside the sector (a rectangle that is on top of the sector is considered inside) | |
| bool | is_free_of_tiles (const Rectf &rect, const bool ignoreUnisolid=false) const |
| Checks if the specified rectangle is free of (solid) tiles. More... | |
| bool | is_free_of_statics (const Rectf &rect, const MovingObject *ignore_object=nullptr, const bool ignoreUnisolid=false) const |
| Checks if the specified rectangle is free of both 1.) solid tiles and 2.) MovingObjects in COLGROUP_STATIC. More... | |
| bool | is_free_of_movingstatics (const Rectf &rect, const MovingObject *ignore_object=nullptr) const |
| Checks if the specified rectangle is free of both 1.) solid tiles and 2.) MovingObjects in COLGROUP_STATIC, COLGROUP_MOVINGSTATIC or COLGROUP_MOVING. More... | |
| bool | free_line_of_sight (const Vector &line_start, const Vector &line_end, const MovingObject *ignore_object=nullptr) const |
| bool | can_see_player (const Vector &eye) const |
| Player * | get_nearest_player (const Vector &pos) const |
| Player * | get_nearest_player (const Rectf &pos) const |
| std::vector< MovingObject * > | get_nearby_objects (const Vector ¢er, float max_distance) const |
| Rectf | get_active_region () const |
| int | get_foremost_layer () const |
| Size | get_editor_size () const |
| returns the editor size (in tiles) of a sector | |
| void | resize_sector (const Size &old_size, const Size &new_size, const Size &resize_offset) |
| resize all tilemaps with given size | |
| void | change_solid_tiles (uint32_t old_tile_id, uint32_t new_tile_id) |
| globally changes solid tilemaps' tile ids | |
| void | set_gravity (float gravity) |
| set gravity throughout sector | |
| float | get_gravity () const |
| void | set_init_script (const std::string &init_script) |
| void | run_script (const std::string &script, const std::string &sourcename) |
| Camera & | get_camera () const |
| Player & | get_player () const |
| DisplayEffect & | get_effect () const |
Public Member Functions inherited from GameObjectManager | |
| GameObject & | add_object (std::unique_ptr< GameObject > object) |
| Queue an object up to be added to the object list. | |
| void | clear_objects () |
| template<typename T , typename... Args> | |
| T & | add (Args &&... args) |
| void | update (float dt_sec) |
| void | draw (DrawingContext &context) |
| const std::vector< std::unique_ptr< GameObject > > & | get_objects () const |
| void | flush_game_objects () |
| Commit the queued up additions and deletions to the object list. | |
| float | get_width () const |
| float | get_height () const |
| float | get_tiles_width () const |
| returns the width (in tiles) of a worldmap | |
| float | get_tiles_height () const |
| returns the height (in tiles) of a worldmap | |
| template<class T > | |
| GameObjectRange< T > | get_objects_by_type () const |
| const std::vector< GameObject * > & | get_objects_by_type_index (std::type_index type_idx) const |
| template<class T > | |
| T & | get_singleton_by_type () const |
| template<class T > | |
| T * | get_object_by_uid (const UID &uid) const |
| void | request_name_resolve (const std::string &name, std::function< void(UID)> callback) |
| Register a callback to be called once the given name can be resolsed to a UID. More... | |
| template<class T > | |
| T * | get_object_by_name (const std::string &name) const |
| template<class T > | |
| int | get_object_count (std::function< bool(const T &)> predicate=nullptr) const |
| Get total number of GameObjects of given type. | |
| const std::vector< TileMap * > & | get_solid_tilemaps () const |
Static Public Member Functions | |
| static Sector & | get () |
| get currently activated sector. More... | |
| static Sector * | current () |
Friends | |
| class | CollisionSystem |
| class | EditorSectorMenu |
Additional Inherited Members | |
Static Public Attributes inherited from GameObjectManager | |
| static bool | s_draw_solids_only = false |
Protected Member Functions inherited from GameObjectManager | |
| void | process_resolve_requests () |
| template<class T > | |
| T * | get_object_by_type () const |
Represents one of (potentially) multiple, separate parts of a Level.
Sectors contain GameObjects, e.g. Badguys and Players.
| void Sector::finish_construction | ( | bool | editable | ) |
Needs to be called after parsing to finish the construction of the Sector before using it.
|
inlinestatic |
get currently activated sector.
| bool Sector::is_free_of_movingstatics | ( | const Rectf & | rect, |
| const MovingObject * | ignore_object = nullptr |
||
| ) | const |
Checks if the specified rectangle is free of both 1.) solid tiles and 2.) MovingObjects in COLGROUP_STATIC, COLGROUP_MOVINGSTATIC or COLGROUP_MOVING.
This includes badguys and players.
| bool Sector::is_free_of_statics | ( | const Rectf & | rect, |
| const MovingObject * | ignore_object = nullptr, |
||
| const bool | ignoreUnisolid = false |
||
| ) | const |
Checks if the specified rectangle is free of both 1.) solid tiles and 2.) MovingObjects in COLGROUP_STATIC.
Note that this does not include badguys or players.
| bool Sector::is_free_of_tiles | ( | const Rectf & | rect, |
| const bool | ignoreUnisolid = false |
||
| ) | const |
Checks if the specified rectangle is free of (solid) tiles.
Note that this does not include static objects, e.g. bonus blocks.
| void Sector::play_looping_sounds | ( | ) |
continues the looping sounds in whole sector.
| void Sector::stop_looping_sounds | ( | ) |
stops all looping sounds in whole sector.
1.8.12