Brunot
Loading...
Searching...
No Matches
Scoring.h
Go to the documentation of this file.
1
12// ____ __ __ __
13// /\__ _\/\ \ /\ \/\ \
14// \/_/\ \/\ \ \___ __ \ \ \_\ \ ___ __ __ ____ __
15// \ \ \ \ \ _ `\ /'__`\ \ \ _ \ / __`\/\ \/\ \ /',__\ /'__`\
16// \ \ \ \ \ \ \ \/\ __/ \ \ \ \ \/\ \L\ \ \ \_\ \/\__, `\/\ __/
17// \ \_\ \ \_\ \_\ \____\ \ \_\ \_\ \____/\ \____/\/\____/\ \____\
18// \/_/ \/_/\/_/\/____/ \/_/\/_/\/___/ \/___/ \/___/ \/____/
19
20
21#pragma once
22
23#include "Framework/System.h"
24
25class Board;
26class Card;
27
28namespace sys
29{
30
35class Scoring : public System
36{
37public:
38#pragma region static_functions
39
43 static auto getEnum() -> Type
44 {
45 return Type::Scoring;
46 }
47
48#pragma endregion
49
50 Scoring();
51 ~Scoring() override = default;
52 Scoring(const Scoring& other) = default;
53 Scoring(Scoring&& other) noexcept;
54 auto operator=(const Scoring& other) -> Scoring&;
55 auto operator=(Scoring&& other) noexcept -> Scoring& = default;
56
57
58#pragma region overridden_functions
59
60 auto clone() const -> std::unique_ptr<GameObject> override
61 {
62 return std::make_unique<Scoring>(*this);
63 }
64
65 auto showMenu() -> void override
66 {
67 }; // for debug ImGUI
68 auto onUpdate(float dt) -> void override;
69
70 auto endWindow() -> void override
71 {
72 }; // for debug ImGUI
73 auto onRender() -> void override;
74 auto load(Stream& stream) -> void override;
75 auto save(Stream& stream) const -> void override;
76
77#pragma endregion
78
79#pragma region scoring_functions
80
87auto scoreBoard(Board& board, const std::vector<Card*>& cards) const -> int;
88
89#pragma endregion
90
91private:
92#pragma region member_variables
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
105};
106}
sys::Json Stream
Definition AudioObject.h:20
Component that is responsible for managing the gameplay board, where cards are placed by Players.
Definition Board.h:38
Definition Card.h:34
GameObject(std::string typeName, gobj::Type parentType, gobj::Type type)
constructor for gameobject.
Definition GameObject.cpp:23
Type
Definition System.h:20
@ Scoring
Definition System.h:30
System(const std::string &typeName, Type systemType)
Definition System.cpp:75
auto operator=(Scoring &&other) noexcept -> Scoring &=default
static auto getEnum() -> Type
function required by all systems
Definition Scoring.h:43
Scoring(const Scoring &other)=default
auto scoreBoard(Board &board, const std::vector< Card * > &cards) const -> int
Checks all played cards and gets the hands.
Definition Scoring.cpp:81
Scoring()
Definition Scoring.cpp:34
~Scoring() override=default
auto endWindow() -> void override
currently unused, but intended to but was assumed to be necessary for a proper ImGui editor
Definition Scoring.h:70
auto save(Stream &stream) const -> void override
Implementations will load the state of a GameObject to a th::Json object.
Definition Scoring.cpp:72
auto clone() const -> std::unique_ptr< GameObject > override
makes a copy a GameObject even if it's held polymorphically
Definition Scoring.h:60
auto operator=(const Scoring &other) -> Scoring &
Definition Scoring.cpp:44
auto load(Stream &stream) -> void override
Implementations will load the state of a GameObject from a th::Json Object.
Definition Scoring.cpp:67
auto onRender() -> void override
called every frame after update has been called for every object.
Definition Scoring.cpp:63
auto showMenu() -> void override
Called before update each frame, for calling ImGui editor code relevant to the gameObject.
Definition Scoring.h:65
auto onUpdate(float dt) -> void override
called once every frame.
Definition Scoring.cpp:58
the type of elements in a basic_json container
Definition GameObject.h:32