Brunot
Loading...
Searching...
No Matches
BroadcastMessageAction.h
Go to the documentation of this file.
1
11// ____ __ __ __
12// /\__ _\/\ \ /\ \/\ \
13// \/_/\ \/\ \ \___ __ \ \ \_\ \ ___ __ __ ____ __
14// \ \ \ \ \ _ `\ /'__`\ \ \ _ \ / __`\/\ \/\ \ /',__\ /'__`\
15// \ \ \ \ \ \ \ \/\ __/ \ \ \ \ \/\ \L\ \ \ \_\ \/\__, `\/\ __/
16// \ \_\ \ \_\ \_\ \____\ \ \_\ \_\ \____/\ \____/\/\____/\ \____\
17// \/_/ \/_/\/_/\/____/ \/_/\/_/\/___/ \/___/ \/___/ \/____/
18
19
20
21
22#pragma once
23#include "Actions/Action.h"
24
26
32{
33public:
34
35#pragma region static_functions
36
37#pragma endregion
38
42 ~BroadcastMessageAction() override = default;
44 auto operator=(BroadcastMessageAction&& other) noexcept -> BroadcastMessageAction& = default;
45
46 // I have to comment this one out or else it throws an error
47 BroadcastMessageAction(std::string eventToBroadcast, std::unique_ptr<Message> messageToBroadcast);
48 BroadcastMessageAction(std::string eventToBroadcast, std::unique_ptr<Message> messageToBroadcast, float duration);
49 BroadcastMessageAction(std::string eventToBroadcast, std::unique_ptr<Message> messageToBroadcast, float duration, const th::Bezier& easingFunction, float initialDelay, float endingDelay);
50
51#pragma region overridden_functions
52
53
54 auto init() -> void override;
55 auto execute() -> void override;
56 auto end() -> void override;
57
58 auto ActionShowMenu() -> void override;
59 auto render() const -> void override;
60
61#pragma endregion
62
63#pragma region BroadcastMessageAction_functions
64
65#pragma endregion
66
67private:
68
69#pragma region member_variables
70
71 // What event we want to broadcast under
72 std::string eventToBroadcast;
73
74 // Unique pointer so the message can safely exist with this action
75 std::unique_ptr<Message> messageToBroadcast = std::make_unique<Message>();
76
77#pragma endregion
78
79#pragma region helper_functions
80
81 #pragma endregion
82
83#pragma region static_variables
84
85#pragma endregion
86
87};
A class that changes a variable over a set duration.
float initialDelay
Definition Action.h:239
float endingDelay
Definition Action.h:240
Action()=default
auto execute() -> void override
Virtual function that is called every frame to change a game object.
Definition BroadcastMessageAction.cpp:70
std::string eventToBroadcast
Definition BroadcastMessageAction.h:72
auto render() const -> void override
Function used to draw things to screen, useful for things such as debug drawing.
Definition BroadcastMessageAction.cpp:84
auto init() -> void override
Virtual function that is called once, when the Action is first starting up.
Definition BroadcastMessageAction.cpp:66
auto operator=(BroadcastMessageAction &&other) noexcept -> BroadcastMessageAction &=default
auto operator=(const BroadcastMessageAction &) -> BroadcastMessageAction &
Definition BroadcastMessageAction.cpp:34
BroadcastMessageAction()=default
auto ActionShowMenu() -> void override
Displays a window in imgui.
Definition BroadcastMessageAction.cpp:80
~BroadcastMessageAction() override=default
auto end() -> void override
Virtual function that is called once, when an Action is finished executing.
Definition BroadcastMessageAction.cpp:74
BroadcastMessageAction(BroadcastMessageAction &&other) noexcept=default
std::unique_ptr< Message > messageToBroadcast
Definition BroadcastMessageAction.h:75
Definition Bezier.h:30