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 <vector>
6
11namespace seq
12{
13
25template<typename T>
26auto change_from_to(T& object,
27 const std::decay_t<T>& begin,
28 const std::decay_t<T>& end,
29 const duration_t& duration,
30 const sentinel_t& sentinel,
31 const ease_t& ease_func = ease::linear) -> seq_action;
32
43template<typename T>
44auto change_from_to(const std::shared_ptr<T>& object,
45 const std::decay_t<T>& begin,
46 const std::decay_t<T>& end,
47 const duration_t& duration,
48 const ease_t& ease_func = ease::linear) -> seq_action;
49
60template<typename T>
61auto change_to(T& object,
62 const std::decay_t<T>& end,
63 const duration_t& duration,
64 const sentinel_t& sentinel,
65 const ease_t& ease_func = ease::linear) -> seq_action;
66
76template<typename T>
77auto change_to(const std::shared_ptr<T>& object,
78 const std::decay_t<T>& end,
79 const duration_t& duration,
80 const ease_t& ease_func = ease::linear) -> seq_action;
81
92template<typename T>
93auto change_by(T& object,
94 const std::decay_t<T>& amount,
95 const duration_t& duration,
96 const sentinel_t& sentinel,
97 const ease_t& ease_func = ease::linear) -> seq_action;
98
108template<typename T>
109auto change_by(const std::shared_ptr<T>& object,
110 const std::decay_t<T>& amount,
111 const duration_t& duration,
112 const ease_t& ease_func = ease::linear) -> seq_action;
113
120auto sequence(const std::vector<seq_action>& actions, const sentinel_t& sentinel = hpp::eternal_sentinel())
121 -> seq_action;
122
129auto sequence_precise(const std::vector<seq_action>& actions, const sentinel_t& sentinel = hpp::eternal_sentinel())
130 -> seq_action;
131
140template<typename... Args>
141auto sequence(const seq_action& t1, const seq_action& t2, Args&&... actions) -> seq_action
142{
143 return sequence(std::vector<seq_action>{t1, t2, std::forward<Args>(actions)...});
144}
145
154template<typename... Args>
155auto sequence_precise(const seq_action& t1, const seq_action& t2, Args&&... actions) -> seq_action
156{
157 return sequence_precise(std::vector<seq_action>{t1, t2, std::forward<Args>(actions)...});
158}
159
166auto together(const std::vector<seq_action>& actions, const sentinel_t& sentinel = hpp::eternal_sentinel())
167 -> seq_action;
168
177template<typename... Args>
178auto together(const seq_action& t1, const seq_action& t2, Args&&... actions) -> seq_action
179{
180 return together(std::vector<seq_action>{t1, t2, std::forward<Args>(actions)...});
181}
182
189auto delay(const duration_t& duration, const sentinel_t& sentinel = hpp::eternal_sentinel()) -> seq_action;
190
197auto repeat(const seq_action& action, size_t times = 0) -> seq_action;
198
206auto repeat(const seq_action& action, const sentinel_t& sentinel, size_t times = 0) -> seq_action;
207
214auto repeat_precise(const seq_action& action, size_t times = 0) -> seq_action;
215
223auto repeat_precise(const seq_action& action, const sentinel_t& sentinel, size_t times = 0) -> seq_action;
224
225} // namespace seq
226
227#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