|
| Sector (Level &parent) |
|
void | finish_construction (bool editable) override |
| Needs to be called after parsing to finish the construction of the Sector before using it. More...
|
|
std::string | get_exposed_class_name () const override |
|
Level & | get_level () const |
|
TileSet * | get_tileset () const override |
|
bool | in_worldmap () const override |
|
void | activate (const std::string &spawnpoint) |
| activates this sector (change music, initialize player class, ...)
|
|
void | activate (const Vector &player_pos) |
|
void | deactivate () |
|
void | draw (DrawingContext &context) override |
|
void | update (float dt_sec) override |
|
void | save (Writer &writer) |
|
void | stop_looping_sounds () |
| stops all looping sounds in whole sector. More...
|
|
void | pause_camera_interpolation () |
| Freeze camera position for this frame, preventing camera interpolation jumps and loops.
|
|
void | play_looping_sounds () |
| continues the looping sounds in whole sector. More...
|
|
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, uint32_t tiletype=Tile::SOLID) const |
| Checks if the specified rectangle is free of (solid) tiles. More...
|
|
bool | is_free_of_solid_tiles (float left, float top, float right, float bottom, bool ignore_unisolid) const |
| Checks if the specified sector-relative 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_statics (float left, float top, float right, float bottom, bool ignore_unisolid) const |
| Checks if the specified sector-relative rectangle is free of both: 1) Solid tiles. 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 | is_free_of_movingstatics (float left, float top, float right, float bottom) const |
| Checks if the specified sector-relative rectangle is free of both: 1) Solid tiles. More...
|
|
bool | is_free_of_specifically_movingstatics (const Rectf &rect, const MovingObject *ignore_object=nullptr) const |
| Checks if the specified rectangle is free of MovingObjects in COLGROUP_MOVINGSTATIC. More...
|
|
bool | is_free_of_specifically_movingstatics (float left, float top, float right, float bottom) const |
| Checks if the specified sector-relative rectangle is free of ""MovingObject""s in ""COLGROUP_MOVINGSTATIC"". More...
|
|
CollisionSystem::RaycastResult | get_first_line_intersection (const Vector &line_start, const Vector &line_end, bool ignore_objects, const CollisionObject *ignore_object) const |
|
bool | free_line_of_sight (const Vector &line_start, const Vector &line_end, bool ignore_objects=false, 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_opaque_layer () 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) |
|
float | get_gravity () const |
|
Camera & | get_camera () const |
|
std::vector< Player * > | get_players () const |
|
DisplayEffect & | get_effect () const |
|
TextObject & | get_text_object () const |
|
Vector | get_spawn_point_position (const std::string &spawnpoint) |
|
| Sector (const std::string &type) |
|
void | set_name (const std::string &name) |
|
const std::string & | get_name () const |
|
void | set_init_script (const std::string &init_script) |
|
void | run_script (const std::string &script, const std::string &sourcename) |
|
| GameObjectManager (bool undo_tracking=false) |
|
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.
|
|
void | set_ambient_light (float red, float green, float blue) |
| Sets the sector's ambient light to the specified color. More...
|
|
void | fade_to_ambient_light (float red, float green, float blue, float fadetime) |
| Fades to a specified ambient light color in ""fadetime"" seconds. More...
|
|
float | get_ambient_red () const |
| Returns the red channel of the ambient light color.
|
|
float | get_ambient_green () const |
| Returns the green channel of the ambient light color.
|
|
float | get_ambient_blue () const |
| Returns the blue channel of the ambient light color.
|
|
void | set_music (const std::string &music) |
| Sets the sector's music. More...
|
|
void | add_object (const std::string &class_name, const std::string &name, float pos_x, float pos_y, const std::string &direction, const std::string &data) |
| Adds a ""MovingObject"" to the manager. More...
|
|
float | get_width () const |
|
float | get_height () const |
|
float | get_editor_width () const |
|
float | get_editor_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 | move_object (const UID &uid, GameObjectManager &other) |
| Move an object to another GameObjectManager. More...
|
|
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 resolved 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 |
|
const std::vector< TileMap * > & | get_all_tilemaps () const |
|
void | update_solid (TileMap *solid) |
|
void | toggle_undo_tracking (bool enabled) |
| Toggle object change tracking for undo/redo. More...
|
|
bool | undo_tracking_enabled () const |
|
void | set_undo_stack_size (int size) |
| Set undo stack size. More...
|
|
void | undo_stack_cleanup () |
| Remove old object changes that exceed the undo stack size limit. More...
|
|
void | undo () |
| Undo/redo changes to GameObjects in the manager. More...
|
|
void | redo () |
|
void | save_object_change (GameObject &object, const std::string &data) |
| Save object change in the undo stack with given data. More...
|
|
void | clear_undo_stack () |
| Clear undo/redo stacks. More...
|
|
bool | has_object_changes () const |
| Indicate if there are any object changes in the undo stack. More...
|
|
void | on_editor_save () |
| Called on editor level save. More...
|
|
Represents one of (potentially) multiple, separate parts of a Level.
Sectors contain GameObjects, e.g. Badguys and Players. This class provides additional controlling functions for a sector, other than the ones listed at ${SRG_REF_GameObjectManager}. An instance under ""sector.settings"" is available from scripts and the console.