42 action.stop_and_finished_ =
true;
51 action.stop_when_finished_ =
true;
61 action.resume({}, force);
99 action.pause_forced();
109 action.pause_forced(key);
119 speed_multiplier = std::min<float>(100.0f, speed_multiplier);
120 speed_multiplier = std::max<float>(0.0f, speed_multiplier);
121 action.speed_multiplier_ = speed_multiplier;
131 return action.speed_multiplier_;
141 return action.state_;
151 return action.stop_when_finished_;
161 return action.stop_and_finished_;
202 return action.update(delta);
222 self.update_elapsed(update_time);
232 return self.elapsed_;
242 return self.duration_;
253 auto elapsed_not_clamped = self.elapsed_not_clamped_;
255 if(duration > duration_t::zero() && duration <= elapsed_not_clamped)
257 return elapsed_not_clamped - duration;
Provides a sequence-based action management system for controlling and scheduling actions.
state_t
Represents the state of a sequence action.
@ running
The action is running.
@ finished
The action has finished.
@ paused
The action is paused.
std::chrono::nanoseconds duration_t
Represents a duration in nanoseconds.
Represents an action within the sequence management system. Contains lifecycle events and management ...
Provides internal utilities for managing seq_action objects. These methods allow for direct control o...
static void pause_forced(seq_action &action)
Forcibly pauses a given action.
static auto get_duration(const seq_action &self) -> duration_t
Gets the total duration of a given action.
static void pause(seq_action &action)
Pauses a given action.
static void start(seq_action &action)
Starts a given action.
static void stop(seq_action &action)
Stops a given action.
static auto update(seq_action &action, duration_t delta) -> state_t
Updates a given action with a time delta.
static auto is_running(const seq_action &action) -> bool
Checks if the action is currently running.
static void set_elapsed(seq_action &self, duration_t elapsed)
Sets the elapsed time of a given action.
static void stop_and_finished(seq_action &action)
Marks a given action as stopped and finished.
static void pause_forced(seq_action &action, const std::string &key)
Forcibly pauses a given action with a specific key.
static void resume(seq_action &action, const std::string &key)
Resumes a given action with a specific key.
static void update_elapsed(seq_action &self, duration_t update_time)
Updates the elapsed time of a given action.
static void stop_when_finished(seq_action &action)
Marks a given action to stop when finished.
static void set_speed_multiplier(seq_action &action, float speed_multiplier)
Sets the speed multiplier for a given action.
static auto get_speed_multiplier(const seq_action &action) -> float
Gets the speed multiplier of a given action.
static void pause(seq_action &action, const std::string &key)
Pauses a given action with a specific key.
static auto is_finished(const seq_action &action) -> bool
Checks if the action is finished.
static auto is_paused(const seq_action &action) -> bool
Checks if the action is currently paused.
static auto get_overflow(const seq_action &self) -> duration_t
Computes the overflow duration of a given action if it exceeds its total duration.
static auto get_state(const seq_action &action) -> state_t
Gets the current state of a given action.
static auto is_stop_and_finished_requested(const seq_action &action) -> bool
Checks if the action is requested to stop and finish.
static auto is_stop_when_finished_requested(const seq_action &action) -> bool
Checks if the action is requested to stop when finished.
static void resume(seq_action &action, bool force=false)
Resumes a given action, optionally forcing the resume.
static auto get_elapsed(const seq_action &self) -> duration_t
Gets the elapsed time of a given action.