Brunot
Loading...
Searching...
No Matches
MainScene.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
24class MainScene : public Component
25{
26public:
27#pragma region static_functions
28 static auto bindLuaTypes(sol::state& lua) -> void {}
29 static auto getEnum() -> ComponentTypeEnum
30 {
31 return cMainScene;
32 }
33
34#pragma endregion
35
36 MainScene();
37 MainScene(const MainScene&);
38 auto operator=(const MainScene&) -> MainScene& = default;
39 ~MainScene() override = default;
40 MainScene(MainScene&& other) noexcept;
41 auto operator=(MainScene&& other) noexcept -> MainScene& = default;
42
43#pragma region overriden_functions
44
45 auto clone() const -> std::unique_ptr<GameObject> override
46 {
47 return std::make_unique<MainScene>(*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 MainScene& n) -> void;
64 friend auto from_json(const json& j, MainScene& n) -> void;
65
66
67#pragma endregion
68
69#pragma region MainScene_functions
70
71 auto pause() -> void;
72
73#pragma endregion
74
75private:
76#pragma region member_variables
77
78#pragma endregion
79
80#pragma region helper_functions
81
82#pragma endregion
83
84#pragma region messaging_functions
85
87 auto receivePauseKeyPressed(const Message* message) -> Message;
88
90 auto receiveControllerDisconnected(const Message* message) -> Message;
91
92 auto linkMessages() -> void;
93
94#pragma endregion
95
96#pragma region static_variables
97
98#pragma endregion
99
100};
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 MainScene.h:25
auto receiveControllerDisconnected(const Message *message) -> Message
Pauses the gameplay.
Definition MainScene.cpp:122
auto load(const Stream &stream) -> void override
Implementations will load the state of a GameObject from a th::Json Object.
Definition MainScene.cpp:72
friend auto from_json(const json &j, MainScene &n) -> void
Definition MainScene.cpp:89
auto onUpdate(float dt) -> void override
called once every frame.
Definition MainScene.cpp:54
auto componentShowMenu() -> void override
Definition MainScene.h:50
auto save(Stream &stream) const -> void override
Implementations will load the state of a GameObject to a th::Json object.
Definition MainScene.cpp:77
auto endWindow() -> void override
currently unused, but intended to but was assumed to be necessary for a proper ImGui editor
Definition MainScene.h:55
static auto bindLuaTypes(sol::state &lua) -> void
Definition MainScene.h:28
auto operator=(MainScene &&other) noexcept -> MainScene &=default
auto onRender() -> void override
called every frame after update has been called for every object.
Definition MainScene.cpp:59
auto clone() const -> std::unique_ptr< GameObject > override
makes a copy a GameObject even if it's held polymorphically
Definition MainScene.h:45
auto onEnterEngine() -> void override
hook that is called when a GameObject enters the Engine tree.
Definition MainScene.cpp:63
~MainScene() override=default
friend auto to_json(json &j, const MainScene &n) -> void
Definition MainScene.cpp:82
auto pause() -> void
Definition MainScene.cpp:98
MainScene()
Definition MainScene.cpp:33
auto receivePauseKeyPressed(const Message *message) -> Message
Pauses the gameplay.
Definition MainScene.cpp:115
static auto getEnum() -> ComponentTypeEnum
Definition MainScene.h:29
auto operator=(const MainScene &) -> MainScene &=default
auto linkMessages() -> void
Definition MainScene.cpp:129
Definition Message.h:35