Brunot
Loading...
Searching...
No Matches
CreateAnimationSequenceAction.h
Go to the documentation of this file.
1
10// ____ __ __ __
11// /\__ _\/\ \ /\ \/\ \
12// \/_/\ \/\ \ \___ __ \ \ \_\ \ ___ __ __ ____ __
13// \ \ \ \ \ _ `\ /'__`\ \ \ _ \ / __`\/\ \/\ \ /',__\ /'__`\
14// \ \ \ \ \ \ \ \/\ __/ \ \ \ \ \/\ \L\ \ \ \_\ \/\__, `\/\ __/
15// \ \_\ \ \_\ \_\ \____\ \ \_\ \_\ \____/\ \____/\/\____/\ \____\
16// \/_/ \/_/\/_/\/____/ \/_/\/_/\/___/ \/___/ \/___/ \/____/
17
18
19#pragma once
20#include "Actions/Action.h"
22
26template<std::derived_from<Action> a>
28{
29public:
30
31#pragma region static_functions
32
33#pragma endregion
34
38 ~CreateAnimationSequenceAction() override = default;
41
50 CreateAnimationSequenceAction(const std::vector<Entity*>& intendedTargets, float entInitialDelay, int setGroup,
51 a intendedAction);
52
61 CreateAnimationSequenceAction(const std::vector<Entity*>& intendedTargets, float entInitialDelay, int setGroup,
62 a intendedAction, float duration);
63
72 CreateAnimationSequenceAction(const std::vector<Entity*>& intendedTargets, float entInitialDelay, int setGroup,
73 a intendedAction, float duration, const th::Bezier& easingFunction,
74 float initialDelay, float endingDelay);
75
76#pragma region overridden_functions
77
78
79 auto init() -> void override;
80 auto execute() -> void override;
81 auto end() -> void override;
82
83 auto ActionShowMenu() -> void override;
84 auto render() const -> void override;
85
86
87#pragma endregion
88
89#pragma region CreateAnimationSequenceAction_functions
90
91#pragma endregion
92
93private:
94
95#pragma region member_variables
96
97 std::vector<Entity*> batch = {};
98 float targetInitialDelay = 0.0f;
99 int group = 0;
100 std::vector<a> actionToAdd;
101
102#pragma endregion
103
104#pragma region helper_functions
105
106 #pragma endregion
107
108#pragma region static_variables
109
110#pragma endregion
111
112};
113
114template <std::derived_from<Action> a>
115CreateAnimationSequenceAction<a>::CreateAnimationSequenceAction(const std::vector<Entity*>& intendedTargets, float entInitialDelay, int setGroup, a intendedAction)
116 : Action("CreateAnimationSequenceAction")
117 , batch(intendedTargets)
118 , targetInitialDelay(entInitialDelay)
119 , group(setGroup)
120 , actionToAdd(intendedAction)
121{
122 as::AnimationSequence(batch, targetInitialDelay, group, actionToAdd);
123}
124
125template <std::derived_from<Action> a>
126CreateAnimationSequenceAction<a>::CreateAnimationSequenceAction(const std::vector<Entity*>& intendedTargets, float entInitialDelay, int setGroup, a intendedAction, float duration)
127 : Action("CreateAnimationSequenceAction", duration)
128 , batch(intendedTargets)
129 , targetInitialDelay(entInitialDelay)
130 , group(setGroup)
131 , actionToAdd(intendedAction)
132{
134}
135
136template <std::derived_from<Action> a>
137CreateAnimationSequenceAction<a>::CreateAnimationSequenceAction(const std::vector<Entity*>& intendedTargets, float entInitialDelay, int setGroup, a intendedAction, float duration,
138 const th::Bezier& easingFunction, float initialDelay, float endingDelay)
139 : Action("CreateAnimationSequenceAction", duration, easingFunction, initialDelay, endingDelay)
140 , batch(intendedTargets)
141 , targetInitialDelay(entInitialDelay)
142 , group(setGroup)
143 , actionToAdd(intendedAction)
144{
146}
147
148template <std::derived_from<Action> a>
152
153template <std::derived_from<Action> a>
157
158template <std::derived_from<Action> a>
162
163template <std::derived_from<Action> a>
168
169template <std::derived_from<Action> a>
A class that changes a variable over a set duration.
Holds functions that assist in sequences, whether it's adding actions with calculated delays,...
virtual auto ActionShowMenu() -> void
Displays a window in imgui.
Definition Action.cpp:116
float initialDelay
Delay that acts between the action being created and the action initializing.
Definition Action.h:262
virtual auto render() const -> void
Function used to draw things to screen, useful for things such as debug drawing.
Definition Action.cpp:110
float endingDelay
Delay that acts after the action has finished updating but before it has ended.
Definition Action.h:264
Action()=default
CreateAnimationSequenceAction(const CreateAnimationSequenceAction &)=default
CreateAnimationSequenceAction(CreateAnimationSequenceAction &&other) noexcept=default
int group
Definition CreateAnimationSequenceAction.h:99
std::vector< Entity * > batch
Definition CreateAnimationSequenceAction.h:97
auto ActionShowMenu() -> void override
Displays a window in imgui.
Definition CreateAnimationSequenceAction.h:164
auto end() -> void override
Virtual function that is called once, when an Action is finished executing.
Definition CreateAnimationSequenceAction.h:159
auto render() const -> void override
Function used to draw things to screen, useful for things such as debug drawing.
Definition CreateAnimationSequenceAction.h:170
auto init() -> void override
Virtual function that is called once, when the Action is first starting up.
Definition CreateAnimationSequenceAction.h:149
float targetInitialDelay
Definition CreateAnimationSequenceAction.h:98
auto execute() -> void override
Virtual function that is called every frame to change a game object.
Definition CreateAnimationSequenceAction.h:154
auto operator=(CreateAnimationSequenceAction &&other) noexcept -> CreateAnimationSequenceAction &=default
std::vector< a > actionToAdd
Definition CreateAnimationSequenceAction.h:100
auto operator=(const CreateAnimationSequenceAction &) -> CreateAnimationSequenceAction &=default
~CreateAnimationSequenceAction() override=default
Holds functions that are useful to synchronize actions such that specific visual effects occur.
Definition AnimationSequence.h:31
Definition Bezier.h:30