Unravel Engine C++ Reference
Loading...
Searching...
No Matches
seq.h
Go to the documentation of this file.
1#pragma once
2#include "seq_core.h"
3#include "seq_manager.h"
4#include <hpp/source_location.hpp>
5
10namespace seq
11{
19auto start(seq_action action,
20 const seq_scope_policy& scope_policy = {},
21 hpp::source_location location = hpp::source_location::current()) -> seq_id_t;
22
27auto queue(seq_action action,
28 const seq_scope_policy& scope_policy = {},
29 hpp::source_location location = hpp::source_location::current()) -> seq_id_t;
30
35void stop(seq_id_t id);
36
41void pause(seq_id_t id);
42
47void resume(seq_id_t id);
48
54
60void stop_and_finish(seq_id_t id, duration_t finish_after = 0ms);
61
66void update(duration_t delta);
67
72void update(duraiton_secs_t delta);
73
77void shutdown();
78
84auto is_stopping(seq_id_t id) -> bool;
85
91auto is_running(seq_id_t id) -> bool;
92
98auto is_paused(seq_id_t id) -> bool;
99
105auto is_finished(seq_id_t id) -> bool;
106
112auto has_action_with_scope(const std::string& scope_id) -> bool;
113
119void set_speed_multiplier(seq_id_t id, float speed_multiplier = 1.0f);
120
126auto get_speed_multiplier(seq_id_t id) -> float;
127
134
140void set_elapsed(seq_id_t id, duration_t duration);
141
147void update(seq_id_t id, duration_t duration);
148
155
162
168auto get_percent(seq_id_t id) -> float;
169
170namespace manager
171{
176void push(seq_manager& mgr);
177
181void pop();
182} // namespace manager
183
184namespace scope
185{
190void push(const std::string& scope);
191
196void close(const std::string& scope);
197
201void pop();
202
206void clear();
207
212auto get_current() -> const std::string&;
213
218void stop_all(const std::string& scope);
219
224void pause_all(const std::string& scope);
225
230void resume_all(const std::string& scope);
231
237void pause_all(const std::string& scope, const std::string& key);
238
244void resume_all(const std::string& scope, const std::string& key);
245
250void stop_and_finish_all(const std::string& scope);
251
256void stop_when_finished_all(const std::string& scope);
257} // namespace scope
258
259} // namespace seq
void pop()
Pops the top sequence manager from the stack.
Definition seq.cpp:203
void push(seq_manager &mgr)
Pushes a sequence manager to the stack.
Definition seq.cpp:199
void pause_all(const std::string &scope)
Pauses all actions within the specified scope.
Definition seq.cpp:165
void stop_when_finished_all(const std::string &scope)
Marks all actions within the specified scope to stop when they finish.
Definition seq.cpp:190
void push(const std::string &scope)
Pushes a new scope to the stack.
Definition seq.cpp:135
void stop_all(const std::string &scope)
Stops all actions within the specified scope.
Definition seq.cpp:160
auto get_current() -> const std::string &
Gets the name of the current scope.
Definition seq.cpp:155
void pop()
Pops the current scope from the stack.
Definition seq.cpp:140
void close(const std::string &scope)
Closes the specified scope.
Definition seq.cpp:145
void clear()
Clears all scopes from the stack.
Definition seq.cpp:150
void resume_all(const std::string &scope)
Resumes all actions within the specified scope.
Definition seq.cpp:170
void stop_and_finish_all(const std::string &scope)
Stops and finishes all actions within the specified scope.
Definition seq.cpp:185
Provides a sequence-based action management system for controlling and scheduling actions.
size_t seq_id_t
Represents a unique identifier for sequence actions.
Definition seq_common.h:53
void update(seq_id_t id, duration_t delta)
Updates the elapsed duration of a specific action.
Definition seq.cpp:100
auto is_finished(seq_id_t id) -> bool
Checks if the action has finished.
Definition seq.cpp:60
std::chrono::duration< float > duraiton_secs_t
Represents a duration in seconds as a floating-point value.
Definition seq_common.h:35
void set_elapsed(seq_id_t id, duration_t duration)
Sets the elapsed duration of an action.
Definition seq.cpp:85
auto is_paused(seq_id_t id) -> bool
Checks if the action is paused.
Definition seq.cpp:55
void resume(const seq_id_t id)
Resumes the action associated with the given ID.
Definition seq.cpp:30
auto get_duration(seq_id_t id) -> duration_t
Gets the total duration of an action.
Definition seq.cpp:90
auto get_overflow(seq_id_t id) -> duration_t
Gets the overflow duration of an action.
Definition seq.cpp:95
void stop_and_finish(seq_id_t id, duration_t finish_after)
Stops the action after a specified duration.
Definition seq.cpp:40
auto is_running(seq_id_t id) -> bool
Checks if the action is running.
Definition seq.cpp:50
void shutdown()
Shuts down the action management system, stopping all actions.
Definition seq.cpp:128
void set_speed_multiplier(seq_id_t id, float speed_multiplier)
Sets the speed multiplier for an action.
Definition seq.cpp:70
auto queue(seq_action action, const seq_scope_policy &scope_policy, hpp::source_location location) -> seq_id_t
Queues a new action.
Definition seq.cpp:14
auto is_stopping(seq_id_t id) -> bool
Checks if the action is stopping.
Definition seq.cpp:45
auto get_speed_multiplier(seq_id_t id) -> float
Gets the speed multiplier of an action.
Definition seq.cpp:75
auto get_elapsed(seq_id_t id) -> duration_t
Gets the elapsed duration of an action.
Definition seq.cpp:80
void stop_when_finished(seq_id_t id)
Marks the action to stop when it finishes.
Definition seq.cpp:35
auto has_action_with_scope(const std::string &scope_id) -> bool
Checks if there is an action associated with the given scope ID.
Definition seq.cpp:65
auto get_percent(seq_id_t id) -> float
Gets the percentage completion of an action.
Definition seq.cpp:105
void stop(seq_id_t id)
Stops the action associated with the given ID.
Definition seq.cpp:20
std::chrono::nanoseconds duration_t
Represents a duration in nanoseconds.
Definition seq_common.h:41
void pause(const seq_id_t id)
Pauses the action associated with the given ID.
Definition seq.cpp:25
std::vector< math::vec3 > start