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 BroadcastMessageAction(std::string eventToBroadcast, std::unique_ptr<Message> messageToBroadcast);
47 BroadcastMessageAction(std::string eventToBroadcast, std::unique_ptr<Message> messageToBroadcast, float duration);
48 BroadcastMessageAction(std::string eventToBroadcast, std::unique_ptr<Message> messageToBroadcast, float duration, const th::Bezier& easingFunction, float initialDelay, float endingDelay);
49
50#pragma region overridden_functions
51
52
53 auto init() -> void override;
54 auto execute() -> void override;
55 auto end() -> void override;
56
57 auto ActionShowMenu() -> void override;
58 auto render() const -> void override;
59
60#pragma endregion
61
62#pragma region BroadcastMessageAction_functions
63
64#pragma endregion
65
66private:
67
68#pragma region member_variables
69
70 // What event we want to broadcast under
71 std::string eventToBroadcast;
72
73 // Unique pointer so the message can safely exist with this action
74 std::unique_ptr<Message> messageToBroadcast = std::make_unique<Message>();
75
76#pragma endregion
77
78#pragma region helper_functions
79
80 #pragma endregion
81
82#pragma region static_variables
83
84#pragma endregion
85
86};
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 BroadcastMessageAction.cpp:70
std::string eventToBroadcast
Definition BroadcastMessageAction.h:71
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:74
Definition Bezier.h:30