Brunot
Loading...
Searching...
No Matches
MoveHorizontalAction.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"
21
22class Transform;
27{
28public:
29
30#pragma region static_functions
31
32#pragma endregion
33
37 ~MoveHorizontalAction() override = default;
38 MoveHorizontalAction(MoveHorizontalAction&& other) noexcept = default;
39 auto operator=(MoveHorizontalAction&& other) noexcept -> MoveHorizontalAction& = default;
40
41 MoveHorizontalAction(float endingXPosition);
42 MoveHorizontalAction(float endingXPosition, float duration);
43 MoveHorizontalAction(float endingXPosition, float duration, const th::Bezier& easingFunction, float initialDelay, float endingDelay);
44
45#pragma region overridden_functions
46
47
48 auto init() -> void override;
49 auto execute() -> void override;
50 auto end() -> void override;
51
52 auto ActionShowMenu() -> void override;
53 auto render() const -> void override;
54
55
56#pragma endregion
57
58#pragma region MoveHorizontalAction_functions
59
60#pragma endregion
61
62private:
63
64#pragma region member_variables
65
66
67 // This variable is nice to have just so you don't need to get the transform every frame in execute
68 Transform* transform = nullptr;
69
70 float startingX = 0.f;
71 float endingX;
72
73
74#pragma endregion
75
76#pragma region helper_functions
77
78 #pragma endregion
79
80#pragma region static_variables
81
82#pragma endregion
83
84};
A class that changes a variable over a set duration.
float initialDelay
Delay that acts between the action being created and the action initializing.
Definition Action.h:262
float endingDelay
Delay that acts after the action has finished updating but before it has ended.
Definition Action.h:264
Action()=default
auto execute() -> void override
Virtual function that is called every frame to change a game object.
Definition MoveHorizontalAction.cpp:58
MoveHorizontalAction(const MoveHorizontalAction &)=default
auto render() const -> void override
Function used to draw things to screen, useful for things such as debug drawing.
Definition MoveHorizontalAction.cpp:73
Transform * transform
Definition MoveHorizontalAction.h:68
MoveHorizontalAction(MoveHorizontalAction &&other) noexcept=default
float endingX
Definition MoveHorizontalAction.h:71
MoveHorizontalAction()=default
float startingX
Definition MoveHorizontalAction.h:70
auto end() -> void override
Virtual function that is called once, when an Action is finished executing.
Definition MoveHorizontalAction.cpp:64
auto init() -> void override
Virtual function that is called once, when the Action is first starting up.
Definition MoveHorizontalAction.cpp:46
auto ActionShowMenu() -> void override
Displays a window in imgui.
Definition MoveHorizontalAction.cpp:68
auto operator=(MoveHorizontalAction &&other) noexcept -> MoveHorizontalAction &=default
~MoveHorizontalAction() override=default
auto operator=(const MoveHorizontalAction &) -> MoveHorizontalAction &=default
Definition Transform.h:28
Definition Bezier.h:30