Brunot
Loading...
Searching...
No Matches
WinScreenScene.h
Go to the documentation of this file.
1
11// ____ __ __ __
12// /\__ _\/\ \ /\ \/\ \
13// \/_/\ \/\ \ \___ __ \ \ \_\ \ ___ __ __ ____ __
14// \ \ \ \ \ _ `\ /'__`\ \ \ _ \ / __`\/\ \/\ \ /',__\ /'__`\
15// \ \ \ \ \ \ \ \/\ __/ \ \ \ \ \/\ \L\ \ \ \_\ \/\__, `\/\ __/
16// \ \_\ \ \_\ \_\ \____\ \ \_\ \_\ \____/\ \____/\/\____/\ \____\
17// \/_/ \/_/\/_/\/____/ \/_/\/_/\/___/ \/___/ \/___/ \/____/
18
19
20#pragma once
21#include "Framework/Component.h"
22#include "Framework/Factory.h"
23
29{
30public:
31#pragma region static_functions
32 static auto bindLuaTypes(sol::state& lua) -> void {}
33 static auto getEnum() -> ComponentTypeEnum
34 {
35 return cWinScreenScene;
36 }
37
38#pragma endregion
39
42 auto operator=(const WinScreenScene&) -> WinScreenScene& = default;
43 ~WinScreenScene() override = default;
44 WinScreenScene(WinScreenScene&& other) noexcept;
45 auto operator=(WinScreenScene&& other) noexcept -> WinScreenScene& = default;
46
47#pragma region overriden_functions
48
49 auto clone() const -> std::unique_ptr<GameObject> override
50 {
51 return std::make_unique<WinScreenScene>(*this);
52 }
53
54 auto componentShowMenu() -> void override
55 {
56 } // for debug ImGUI
57 auto onUpdate(float dt) -> void override;
58
59 auto endWindow() -> void override
60 {
61 } // for debug ImGUI
62 auto onRender() -> void override;
63 auto load(const Stream& stream) -> void override;
64 auto save(Stream& stream) const -> void override;
65
66 friend auto to_json(json& j, const WinScreenScene& n) -> void;
67 friend auto from_json(const json& j, WinScreenScene& n) -> void;
68
69
70#pragma endregion
71
72#pragma region WinScreenScene_functions
73
74 auto loadWinScreenData(Stream& stream) -> void;
75
76#pragma endregion
77
78#pragma region messaging_functions
79 auto linkMessages() -> void;
80
81 auto playAgainButtonPressed(const Message* message) -> Message;
82 auto goToMainMenuButtonPressed(const Message* message) -> Message;
83 auto quitButtonPressed(const Message* message) -> Message;
84
85#pragma endregion
86
87private:
88#pragma region member_variables
89
90#pragma endregion
91
92#pragma region helper_functions
93
101 auto getAllTyingPlayers(const std::vector<std::pair<int, int>>& playersAndScores) const -> std::vector<int>;
102
110 auto getFormattedTyingText(const std::vector<int>& tyingPlayerNumbers) const -> std::string;
111
112#pragma endregion
113
114#pragma region static_variables
115
116#pragma endregion
117
118};
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
An indicator that loops through a parents' nodes children and can "select" them on keypress.
Definition WinScreenScene.h:29
static auto getEnum() -> ComponentTypeEnum
Definition WinScreenScene.h:33
auto componentShowMenu() -> void override
Definition WinScreenScene.h:54
auto operator=(const WinScreenScene &) -> WinScreenScene &=default
static auto bindLuaTypes(sol::state &lua) -> void
Definition WinScreenScene.h:32
auto getAllTyingPlayers(const std::vector< std::pair< int, int > > &playersAndScores) const -> std::vector< int >
Gets all the numbers of players who tied for first place.
Definition WinScreenScene.cpp:182
auto linkMessages() -> void
Definition WinScreenScene.cpp:127
auto getFormattedTyingText(const std::vector< int > &tyingPlayerNumbers) const -> std::string
Creates the appropriate formatted text for all the players that tied.
Definition WinScreenScene.cpp:207
auto load(const Stream &stream) -> void override
Implementations will load the state of a GameObject from a th::Json Object.
Definition WinScreenScene.cpp:64
WinScreenScene()
Definition WinScreenScene.cpp:34
auto playAgainButtonPressed(const Message *message) -> Message
Definition WinScreenScene.cpp:155
auto save(Stream &stream) const -> void override
Implementations will load the state of a GameObject to a th::Json object.
Definition WinScreenScene.cpp:69
auto onRender() -> void override
called every frame after update has been called for every object.
Definition WinScreenScene.cpp:60
friend auto to_json(json &j, const WinScreenScene &n) -> void
Definition WinScreenScene.cpp:74
auto onUpdate(float dt) -> void override
called once every frame.
Definition WinScreenScene.cpp:55
auto loadWinScreenData(Stream &stream) -> void
Definition WinScreenScene.cpp:90
auto operator=(WinScreenScene &&other) noexcept -> WinScreenScene &=default
~WinScreenScene() override=default
friend auto from_json(const json &j, WinScreenScene &n) -> void
Definition WinScreenScene.cpp:81
auto quitButtonPressed(const Message *message) -> Message
Definition WinScreenScene.cpp:174
auto clone() const -> std::unique_ptr< GameObject > override
makes a copy a GameObject even if it's held polymorphically
Definition WinScreenScene.h:49
auto goToMainMenuButtonPressed(const Message *message) -> Message
Definition WinScreenScene.cpp:162
auto endWindow() -> void override
currently unused, but intended to but was assumed to be necessary for a proper ImGui editor
Definition WinScreenScene.h:59
Definition Message.h:35