Unravel Engine C++ Reference
Loading...
Searching...
No Matches
seq_core.h
Go to the documentation of this file.
1#pragma once
2#include "seq_common.h"
3#include "seq_ease.h"
4#include "seq_private.h"
5#include <functional>
6#include <vector>
7
12namespace seq
13{
14
26template<typename T>
27auto change_from_to(T& object,
28 const std::decay_t<T>& begin,
29 const std::decay_t<T>& end,
30 const duration_t& duration,
31 const sentinel_t& sentinel,
32 const ease_t& ease_func = ease::linear) -> seq_action;
33
44template<typename T>
45auto change_from_to(const std::shared_ptr<T>& object,
46 const std::decay_t<T>& begin,
47 const std::decay_t<T>& end,
48 const duration_t& duration,
49 const ease_t& ease_func = ease::linear) -> seq_action;
50
61template<typename T>
62auto change_to(T& object,
63 const std::decay_t<T>& end,
64 const duration_t& duration,
65 const sentinel_t& sentinel,
66 const ease_t& ease_func = ease::linear) -> seq_action;
67
77template<typename T>
78auto change_to(const std::shared_ptr<T>& object,
79 const std::decay_t<T>& end,
80 const duration_t& duration,
81 const ease_t& ease_func = ease::linear) -> seq_action;
82
93template<typename T>
94auto change_by(T& object,
95 const std::decay_t<T>& amount,
96 const duration_t& duration,
97 const sentinel_t& sentinel,
98 const ease_t& ease_func = ease::linear) -> seq_action;
99
109template<typename T>
110auto change_by(const std::shared_ptr<T>& object,
111 const std::decay_t<T>& amount,
112 const duration_t& duration,
113 const ease_t& ease_func = ease::linear) -> seq_action;
114
121auto sequence(const std::vector<seq_action>& actions, const sentinel_t& sentinel = hpp::eternal_sentinel())
122 -> seq_action;
123
130auto sequence_precise(const std::vector<seq_action>& actions, const sentinel_t& sentinel = hpp::eternal_sentinel())
131 -> seq_action;
132
141template<typename... Args>
142auto sequence(const seq_action& t1, const seq_action& t2, Args&&... actions) -> seq_action
143{
144 return sequence(std::vector<seq_action>{t1, t2, std::forward<Args>(actions)...});
145}
146
155template<typename... Args>
156auto sequence_precise(const seq_action& t1, const seq_action& t2, Args&&... actions) -> seq_action
157{
158 return sequence_precise(std::vector<seq_action>{t1, t2, std::forward<Args>(actions)...});
159}
160
167auto together(const std::vector<seq_action>& actions, const sentinel_t& sentinel = hpp::eternal_sentinel())
168 -> seq_action;
169
178template<typename... Args>
179auto together(const seq_action& t1, const seq_action& t2, Args&&... actions) -> seq_action
180{
181 return together(std::vector<seq_action>{t1, t2, std::forward<Args>(actions)...});
182}
183
190auto delay(const duration_t& duration, const sentinel_t& sentinel = hpp::eternal_sentinel()) -> seq_action;
191
198auto repeat(const seq_action& action, size_t times = 0) -> seq_action;
199
207auto repeat(const seq_action& action, const sentinel_t& sentinel, size_t times = 0) -> seq_action;
208
215auto repeat_precise(const seq_action& action, size_t times = 0) -> seq_action;
216
224auto repeat_precise(const seq_action& action, const sentinel_t& sentinel, size_t times = 0) -> seq_action;
225
226} // namespace seq
227
228#include "seq_core.hpp"
float linear(float progress)
Definition seq_ease.cpp:292
Provides a sequence-based action management system for controlling and scheduling actions.
hpp::sentinel sentinel_t
Alias for a sentinel object used for lifecycle management.
Definition seq_common.h:47
auto sequence_precise(const std::vector< seq_action > &actions, const sentinel_t &sentinel) -> seq_action
Creates a precise sequential action that executes a list of actions with exact timing.
Definition seq_core.cpp:104
auto repeat(const seq_action &action, size_t times) -> seq_action
Repeats an action a specified number of times.
Definition seq_core.cpp:316
std::function< float(float)> ease_t
Represents an easing function for interpolation.
Definition seq_common.h:61
auto change_by(T &object, const std::decay_t< T > &amount, const duration_t &duration, const sentinel_t &sentinel, const ease_t &ease_func=ease::linear) -> seq_action
Creates an action to change an object by a specified amount over a specified duration.
Definition seq_core.hpp:139
auto repeat_precise(const seq_action &action, size_t times) -> seq_action
Precisely repeats an action a specified number of times.
Definition seq_core.cpp:326
auto delay(const duration_t &duration, const sentinel_t &sentinel) -> seq_action
Creates a delay action.
Definition seq_core.cpp:182
auto change_from_to(T &object, const std::decay_t< T > &begin, const std::decay_t< T > &end, const duration_t &duration, const sentinel_t &sentinel, const ease_t &ease_func=ease::linear) -> seq_action
Creates an action to change an object from one value to another over a specified duration.
Definition seq_core.hpp:11
auto sequence(const std::vector< seq_action > &actions, const sentinel_t &sentinel) -> seq_action
Creates a sequential action that executes a list of actions one after another.
Definition seq_core.cpp:99
std::chrono::nanoseconds duration_t
Represents a duration in nanoseconds.
Definition seq_common.h:41
auto together(const std::vector< seq_action > &actions, const sentinel_t &sentinel) -> seq_action
Creates a simultaneous action that executes a list of actions together.
Definition seq_core.cpp:109
auto change_to(T &object, const std::decay_t< T > &end, const duration_t &duration, const sentinel_t &sentinel, const ease_t &ease_func=ease::linear) -> seq_action
Creates an action to change an object to a specified value over a specified duration.
Definition seq_core.hpp:76
Represents an action within the sequence management system. Contains lifecycle events and management ...
Definition seq_action.h:18