|
| GameObjectManager (bool undo_tracking=false) |
|
virtual std::string | get_exposed_class_name () const override |
|
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
|
|
virtual bool | before_object_add (GameObject &object)=0 |
| Hook that is called before an object is added to the vector.
|
|
virtual void | before_object_remove (GameObject &object)=0 |
| Hook that is called before an object is removed from the vector.
|
|
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...
|
|
This class provides basic controlling functions for a sector.
Applies for both worldmap and in-level sectors. For in-level sectors, an instance under ""sector.settings"" is available from scripts and the console.${SRG_NEWPARAGRAPH} For worldmap sectors, such instance is available under ""worldmap.settings"".