|
Unravel Engine C++ Reference
|
Manages and coordinates multiple sequence actions with scoping, pausing, and updating capabilities. More...
#include <seq_manager.h>
Classes | |
| struct | seq_info |
| Stores information about an action, including its state, depth, and associated scopes. More... | |
Public Types | |
| using | action_collection_t = std::map<seq_id_t, seq_info> |
| Alias for the collection of actions managed by the seq_manager. | |
Public Member Functions | |
| seq_id_t | start (seq_action action, const seq_scope_policy &scope_policy={}) |
| Starts a new action and associates it with the specified scope policy. | |
| void | stop (seq_id_t id) |
| Stops the action associated with the specified ID. | |
| void | stop_all (const std::string &scope={}) |
| Stops all actions within the specified scope. | |
| void | pause (seq_id_t id) |
| Pauses the action associated with the specified ID. | |
| void | pause_all (const std::string &scope={}, const std::string &key={}) |
| Pauses all actions within the specified scope and key. | |
| void | resume (seq_id_t id) |
| Resumes the action associated with the specified ID. | |
| void | resume_all (const std::string &scope={}, const std::string &key={}) |
| Resumes all actions within the specified scope and key. | |
| void | stop_when_finished (seq_id_t id) |
| Marks an action to stop when it finishes. | |
| void | stop_when_finished_all (const std::string &scope={}) |
| Marks all actions in the specified scope to stop when they finish. | |
| void | stop_and_finish (seq_id_t id, duration_t finish_after=0ms) |
| Stops an action and ensures it completes after the specified duration. | |
| void | stop_and_finish_all (const std::string &scope={}) |
| Stops all actions in the specified scope and ensures they complete. | |
| auto | is_stopping (seq_id_t id) const -> bool |
| Checks if an action is stopping. | |
| auto | is_running (seq_id_t id) const -> bool |
| Checks if an action is running. | |
| auto | is_paused (seq_id_t id) const -> bool |
| Checks if an action is paused. | |
| auto | is_finished (seq_id_t id) const -> bool |
| Checks if an action has finished. | |
| bool | has_action_with_scope (const std::string &scope_id) |
| Checks if there is any action associated with the specified scope ID. | |
| void | set_speed_multiplier (seq_id_t id, float speed_multiplier=1.0f) |
| Sets the speed multiplier for an action. | |
| auto | get_speed_multiplier (seq_id_t id) -> float |
| Gets the speed multiplier of an action. | |
| auto | get_elapsed (seq_id_t id) const -> duration_t |
| Gets the elapsed time of an action. | |
| auto | get_duration (seq_id_t id) const -> duration_t |
| Gets the total duration of an action. | |
| auto | get_overflow (seq_id_t id) const -> duration_t |
| Gets the overflow time of an action. | |
| void | update (seq_id_t id, duration_t delta) |
| Updates the elapsed time of a specific action. | |
| void | set_elapsed (seq_id_t id, duration_t elapsed) |
| Sets the elapsed time of an action (use with caution). | |
| void | update (duration_t delta) |
| Updates all managed actions with a time delta. | |
| void | push_scope (const std::string &scope) |
| Pushes a scope onto the scope stack. | |
| void | close_scope (const std::string &scope) |
| Closes a scope, removing it from the stack. | |
| void | pop_scope () |
| Pops the current scope from the scope stack. | |
| void | clear_scopes () |
| Clears all scopes from the scope stack. | |
| auto | get_current_scope () const -> const std::string & |
| Gets the current scope from the scope stack. | |
| auto | get_scopes () const -> const std::vector< std::string > & |
| Gets the list of all active scopes. | |
| auto | get_actions () const -> const action_collection_t & |
| Gets the collection of all managed actions. | |
Manages and coordinates multiple sequence actions with scoping, pausing, and updating capabilities.
Definition at line 17 of file seq_manager.h.
| using seq::seq_manager::action_collection_t = std::map<seq_id_t, seq_info> |
Alias for the collection of actions managed by the seq_manager.
Definition at line 44 of file seq_manager.h.
| void seq::seq_manager::clear_scopes | ( | ) |
Clears all scopes from the scope stack.
Definition at line 390 of file seq_manager.cpp.
| void seq::seq_manager::close_scope | ( | const std::string & | scope | ) |
Closes a scope, removing it from the stack.
| scope | The name of the scope to close. |
Definition at line 382 of file seq_manager.cpp.
| auto seq::seq_manager::get_actions | ( | ) | const -> const action_collection_t& |
Gets the collection of all managed actions.
Definition at line 442 of file seq_manager.cpp.
| auto seq::seq_manager::get_current_scope | ( | ) | const -> const std::string& |
Gets the current scope from the scope stack.
Definition at line 427 of file seq_manager.cpp.
| auto seq::seq_manager::get_duration | ( | seq_id_t | id | ) | const -> duration_t |
Gets the total duration of an action.
| id | The ID of the action. |
Definition at line 272 of file seq_manager.cpp.
| auto seq::seq_manager::get_elapsed | ( | seq_id_t | id | ) | const -> duration_t |
Gets the elapsed time of an action.
| id | The ID of the action. |
Definition at line 262 of file seq_manager.cpp.
| auto seq::seq_manager::get_overflow | ( | seq_id_t | id | ) | const -> duration_t |
Gets the overflow time of an action.
| id | The ID of the action. |
Definition at line 282 of file seq_manager.cpp.
| auto seq::seq_manager::get_scopes | ( | ) | const -> const std::vector<std::string>& |
Gets the list of all active scopes.
Definition at line 437 of file seq_manager.cpp.
| float seq::seq_manager::get_speed_multiplier | ( | seq_id_t | id | ) | -> float |
Gets the speed multiplier of an action.
| id | The ID of the action. |
Definition at line 252 of file seq_manager.cpp.
| auto seq::seq_manager::has_action_with_scope | ( | const std::string & | scope_id | ) |
Checks if there is any action associated with the specified scope ID.
| scope_id | The scope ID to check. |
Definition at line 458 of file seq_manager.cpp.
| auto seq::seq_manager::is_finished | ( | seq_id_t | id | ) | const -> bool |
Checks if an action has finished.
| id | The ID of the action to check. |
Definition at line 233 of file seq_manager.cpp.
| auto seq::seq_manager::is_paused | ( | seq_id_t | id | ) | const -> bool |
Checks if an action is paused.
| id | The ID of the action to check. |
Definition at line 223 of file seq_manager.cpp.
| auto seq::seq_manager::is_running | ( | seq_id_t | id | ) | const -> bool |
Checks if an action is running.
| id | The ID of the action to check. |
Definition at line 213 of file seq_manager.cpp.
| auto seq::seq_manager::is_stopping | ( | seq_id_t | id | ) | const -> bool |
Checks if an action is stopping.
| id | The ID of the action to check. |
Definition at line 203 of file seq_manager.cpp.
| void seq::seq_manager::pause | ( | seq_id_t | id | ) |
Pauses the action associated with the specified ID.
| id | The ID of the action to pause. |
Definition at line 89 of file seq_manager.cpp.
| void seq::seq_manager::pause_all | ( | const std::string & | scope = {}, |
| const std::string & | key = {} ) |
Pauses all actions within the specified scope and key.
| scope | The name of the scope (default is all scopes). |
| key | The key associated with the actions (default is all keys). |
Definition at line 98 of file seq_manager.cpp.
| void seq::seq_manager::pop_scope | ( | ) |
Pops the current scope from the scope stack.
Definition at line 374 of file seq_manager.cpp.
| void seq::seq_manager::push_scope | ( | const std::string & | scope | ) |
Pushes a scope onto the scope stack.
| scope | The name of the scope to push. |
Definition at line 357 of file seq_manager.cpp.
| void seq::seq_manager::resume | ( | seq_id_t | id | ) |
Resumes the action associated with the specified ID.
| id | The ID of the action to resume. |
Definition at line 111 of file seq_manager.cpp.
| void seq::seq_manager::resume_all | ( | const std::string & | scope = {}, |
| const std::string & | key = {} ) |
Resumes all actions within the specified scope and key.
| scope | The name of the scope (default is all scopes). |
| key | The key associated with the actions (default is all keys). |
Definition at line 120 of file seq_manager.cpp.
| void seq::seq_manager::set_elapsed | ( | seq_id_t | id, |
| duration_t | elapsed ) |
Sets the elapsed time of an action (use with caution).
| id | The ID of the action. |
| elapsed | The elapsed time to set. |
Definition at line 301 of file seq_manager.cpp.
| void seq::seq_manager::set_speed_multiplier | ( | seq_id_t | id, |
| float | speed_multiplier = 1.0f ) |
Sets the speed multiplier for an action.
| id | The ID of the action. |
| speed_multiplier | The speed multiplier to set (default is 1.0f). |
Definition at line 243 of file seq_manager.cpp.
| auto seq::seq_manager::start | ( | seq_action | action, |
| const seq_scope_policy & | scope_policy = {} ) |
Starts a new action and associates it with the specified scope policy.
| action | The action to start. |
| scope_policy | The scoping policy for the action (default is empty). |
Definition at line 9 of file seq_manager.cpp.
| void seq::seq_manager::stop | ( | seq_id_t | id | ) |
Stops the action associated with the specified ID.
| id | The ID of the action to stop. |
Definition at line 63 of file seq_manager.cpp.
| void seq::seq_manager::stop_all | ( | const std::string & | scope = {} | ) |
Stops all actions within the specified scope.
| scope | The name of the scope (default is all scopes). |
Definition at line 78 of file seq_manager.cpp.
| void seq::seq_manager::stop_and_finish | ( | seq_id_t | id, |
| duration_t | finish_after = 0ms ) |
Stops an action and ensures it completes after the specified duration.
| id | The ID of the action to stop. |
| finish_after | The duration to wait before stopping (default is 0ms). |
Definition at line 153 of file seq_manager.cpp.
| void seq::seq_manager::stop_and_finish_all | ( | const std::string & | scope = {} | ) |
Stops all actions in the specified scope and ensures they complete.
| scope | The name of the scope (default is all scopes). |
Definition at line 192 of file seq_manager.cpp.
| void seq::seq_manager::stop_when_finished | ( | seq_id_t | id | ) |
Marks an action to stop when it finishes.
| id | The ID of the action to mark. |
Definition at line 133 of file seq_manager.cpp.
| void seq::seq_manager::stop_when_finished_all | ( | const std::string & | scope = {} | ) |
Marks all actions in the specified scope to stop when they finish.
| scope | The name of the scope (default is all scopes). |
Definition at line 142 of file seq_manager.cpp.
| void seq::seq_manager::update | ( | duration_t | delta | ) |
Updates all managed actions with a time delta.
| delta | The time delta to apply. |
Definition at line 312 of file seq_manager.cpp.
| void seq::seq_manager::update | ( | seq_id_t | id, |
| duration_t | delta ) |
Updates the elapsed time of a specific action.
| id | The ID of the action. |
| delta | The time delta to apply. |
Definition at line 292 of file seq_manager.cpp.