Brunot
Loading...
Searching...
No Matches
PlayerCountScene.h
Go to the documentation of this file.
1
11// ____ __ __ __
12// /\__ _\/\ \ /\ \/\ \
13// \/_/\ \/\ \ \___ __ \ \ \_\ \ ___ __ __ ____ __
14// \ \ \ \ \ _ `\ /'__`\ \ \ _ \ / __`\/\ \/\ \ /',__\ /'__`\
15// \ \ \ \ \ \ \ \/\ __/ \ \ \ \ \/\ \L\ \ \ \_\ \/\__, `\/\ __/
16// \ \_\ \ \_\ \_\ \____\ \ \_\ \_\ \____/\ \____/\/\____/\ \____\
17// \/_/ \/_/\/_/\/____/ \/_/\/_/\/___/ \/___/ \/___/ \/____/
18
19#pragma once
20#include "Framework/Component.h"
21
22struct Message;
23
25{
26public:
27#pragma region static_functions
28 static auto bindLuaTypes(sol::state& lua) -> void {}
29 static auto getEnum() -> ComponentTypeEnum
30 {
31 return cPlayerCountScene;
32 }
33
34#pragma endregion
35
38 auto operator=(const PlayerCountScene&) -> PlayerCountScene& = default;
39 ~PlayerCountScene() override = default;
40 PlayerCountScene(PlayerCountScene&& other) noexcept;
41 auto operator=(PlayerCountScene&& other) noexcept -> PlayerCountScene& = default;
42
43#pragma region overriden_functions
44
45 auto clone() const -> std::unique_ptr<GameObject> override
46 {
47 return std::make_unique<PlayerCountScene>(*this);
48 }
49
50 auto componentShowMenu() -> void override
51 {
52 } // for debug ImGUI
53 auto onUpdate(float dt) -> void override;
54
55 auto endWindow() -> void override
56 {
57 } // for debug ImGUI
58 auto onRender() -> void override;
59 auto onEnterEngine() -> void override;
60 auto load(const Stream& stream) -> void override;
61 auto save(Stream& stream) const -> void override;
62
63 friend auto to_json(json& j, const PlayerCountScene& n) -> void;
64 friend auto from_json(const json& j, PlayerCountScene& n) -> void;
65
66
67#pragma endregion
68
69#pragma region PlayerCountScene_functions
70
71#pragma endregion
72
73#pragma region messaging_functions
74
75 auto linkMessages() -> void;
76
80 auto countButtonPressed(const Message* message) -> Message;
81
85 auto receivePauseKeyPressed(const Message* message) -> Message;
86
87#pragma endregion
88
89private:
90#pragma region member_variables
91
92 int playerCount = 2;
93
94#pragma endregion
95
96#pragma region helper_functions
97
98#pragma endregion
99
100#pragma region static_variables
101
102#pragma endregion
103
104};
sys::Json Stream
Definition AudioObject.h:20
The base class for components, holding all of their shared All components should inherit from this.
nlohmann::json json
Definition Json.cpp:19
ComponentTypeEnum
This enum lists out every type of component we have.
Definition Component.h:39
Component(ComponentTypeEnum type, const char *typeName)
Definition Component.cpp:72
GameObject(std::string typeName, gobj::Type parentType, gobj::Type type)
constructor for gameobject.
Definition GameObject.cpp:24
Definition PlayerCountScene.h:25
auto linkMessages() -> void
Definition PlayerCountScene.cpp:93
auto onUpdate(float dt) -> void override
called once every frame.
Definition PlayerCountScene.cpp:54
auto save(Stream &stream) const -> void override
Implementations will load the state of a GameObject to a th::Json object.
Definition PlayerCountScene.cpp:73
friend auto from_json(const json &j, PlayerCountScene &n) -> void
Definition PlayerCountScene.cpp:85
auto countButtonPressed(const Message *message) -> Message
Activates whenever a player count is selected.
Definition PlayerCountScene.cpp:112
auto load(const Stream &stream) -> void override
Implementations will load the state of a GameObject from a th::Json Object.
Definition PlayerCountScene.cpp:68
auto clone() const -> std::unique_ptr< GameObject > override
makes a copy a GameObject even if it's held polymorphically
Definition PlayerCountScene.h:45
auto onRender() -> void override
called every frame after update has been called for every object.
Definition PlayerCountScene.cpp:59
auto componentShowMenu() -> void override
Definition PlayerCountScene.h:50
auto endWindow() -> void override
currently unused, but intended to but was assumed to be necessary for a proper ImGui editor
Definition PlayerCountScene.h:55
int playerCount
Definition PlayerCountScene.h:92
auto operator=(const PlayerCountScene &) -> PlayerCountScene &=default
auto operator=(PlayerCountScene &&other) noexcept -> PlayerCountScene &=default
static auto bindLuaTypes(sol::state &lua) -> void
Definition PlayerCountScene.h:28
~PlayerCountScene() override=default
friend auto to_json(json &j, const PlayerCountScene &n) -> void
Definition PlayerCountScene.cpp:78
PlayerCountScene()
Definition PlayerCountScene.cpp:33
auto onEnterEngine() -> void override
hook that is called when a GameObject enters the Engine tree.
Definition PlayerCountScene.cpp:63
static auto getEnum() -> ComponentTypeEnum
Definition PlayerCountScene.h:29
auto receivePauseKeyPressed(const Message *message) -> Message
Takes the player back to Main Menu.
Definition PlayerCountScene.cpp:130
Definition Message.h:35