31#pragma region static_functions
51#pragma region overridden_functions
55 return std::make_unique<GameRules>(*
this);
58 auto onUpdate(
float dt) ->
void override;
65 auto load(
const Stream& stream) ->
void override;
66 auto save(
Stream& stream)
const ->
void override;
70#pragma region GameRules_Functions
76 [[nodiscard]]
auto getSeed() const ->
unsigned int;
121#pragma region member_variables
167#pragma region helper_functions
171#pragma region static_variables
sys::Json Stream
Definition AudioObject.h:20
A class that can get the score of a hand.
GameObject(std::string typeName, gobj::Type parentType, gobj::Type type)
constructor for gameobject.
Definition GameObject.cpp:24
Definition HandRating.h:30
Type
Definition System.h:20
@ GameRules
Definition System.h:41
System(const std::string &typeName, Type systemType)
Definition System.cpp:75
auto setScoreCalculator(bool enabled) -> void
Definition GameRules.cpp:206
auto setSeed(unsigned int seed) -> void
if for some reason you want set the seed manually in code, instead of ImGui, you can set it here make...
Definition GameRules.cpp:141
auto setHelpPopUp(bool enabled) -> void
Definition GameRules.cpp:245
GameRules(GameRules &&other) noexcept=default
unsigned int seed
seed to use to seed random generators for gameplay events
Definition GameRules.h:126
auto getBoardDimensions() const -> const std::pair< int, int > &
Definition GameRules.cpp:171
int timeLimitPointPenalty
The amount of points players lose if they run out of time.
Definition GameRules.h:136
auto setPlayerCount(int count) -> void
Definition GameRules.cpp:260
bool useSetSeed
whether GameRules should generate seed from a random number on construction
Definition GameRules.h:124
auto getSeed() const -> unsigned int
get the seed we use for making random number generators, so we can have a consistent gameplay if we w...
Definition GameRules.cpp:136
bool scoreCalculator
if the player has scoring calculator enabled
Definition GameRules.h:139
auto getCardsPlayedPerTurnLimit() const -> int
Definition GameRules.cpp:161
auto getTimeLimitPointPenalty() const -> int
Definition GameRules.cpp:191
auto systemShowMenu() -> void override
Specific systems should override this function to show their specific menu for the system.
Definition GameRules.cpp:107
auto getHelpPopUp() const -> bool
Definition GameRules.cpp:250
Vector4D twoPairColor
Definition GameRules.h:158
bool passAndPlay
If we want to support multiple device inputs at the same time in the gameplay scene.
Definition GameRules.h:149
auto operator=(const GameRules &other) -> GameRules &
Definition GameRules.cpp:88
auto getPlayerTimeLimit() const -> float
Definition GameRules.cpp:181
auto setCardsPlayedPerTurnLimit(int newMax) -> void
Definition GameRules.cpp:166
auto getPlayerCount() const -> int
Definition GameRules.cpp:255
GameRules(const GameRules &other)=default
Vector4D tripsColor
Definition GameRules.h:157
bool helpPopUp
Definition GameRules.h:163
std::pair< int, int > boardDimensions
Definition GameRules.h:130
auto clone() const -> std::unique_ptr< GameObject > override
makes a copy a GameObject even if it's held polymorphically
Definition GameRules.h:53
Vector4D quadsColor
Definition GameRules.h:153
auto setBoardDimensions(const std::pair< int, int > &newDimensions) -> void
Definition GameRules.cpp:176
Vector4D fullHouseColor
Definition GameRules.h:154
Vector4D pairColor
Definition GameRules.h:159
auto onUpdate(float dt) -> void override
called once every frame.
Definition GameRules.cpp:102
auto onRender() -> void override
called every frame after update has been called for every object.
Definition GameRules.cpp:122
int playerCount
Tracks how many players we want in our game.
Definition GameRules.h:146
float timeLimitPerPlayer
The time limit is stored in seconds.
Definition GameRules.h:133
auto setPassAndPlay(bool newState) -> void
Definition GameRules.cpp:270
auto setPlayerTimeLimit(float newLimit) -> void
Definition GameRules.cpp:186
auto setTimeLimitPointPenalty(int newPenalty) -> void
Definition GameRules.cpp:196
Vector4D flushColor
Definition GameRules.h:155
auto load(const Stream &stream) -> void override
Implementations will load the state of a GameObject from a th::Json Object.
Definition GameRules.cpp:126
Vector4D straightColor
Definition GameRules.h:156
auto setMaxPlayerCards(int newMax) -> void
Definition GameRules.cpp:156
auto getMaxPlayerCards() const -> int
Definition GameRules.cpp:151
int maxCardsPerPlayerHand
Definition GameRules.h:128
auto endWindow() -> void override
currently unused, but intended to but was assumed to be necessary for a proper ImGui editor
Definition GameRules.h:61
auto getHandTypeColor(HandRating::HandType handType) const -> Vector4D
Definition GameRules.cpp:211
~GameRules() override=default
auto getScoreCalculator() const -> bool
Definition GameRules.cpp:201
GameRules()
Definition GameRules.cpp:77
auto save(Stream &stream) const -> void override
Implementations will load the state of a GameObject to a th::Json object.
Definition GameRules.cpp:131
auto getHandTypeValue(HandRating::HandType handType) const -> int
Definition GameRules.cpp:240
auto operator=(GameRules &&other) noexcept -> GameRules &=default
Vector4D highCardColor
Definition GameRules.h:160
Vector4D straightFlushColor
the different colors for hand types
Definition GameRules.h:152
float gameSpeedModifier
Affects the speed of the animations in game.
Definition GameRules.h:143
static auto getEnum() -> Type
function required by all systems
Definition GameRules.h:36
auto getPassAndPlay() const -> bool
Sets if we want to pass and play when we start the gameplay scene Also causes us to load PlayerCountS...
Definition GameRules.cpp:265
int maxNumberOfCardsPlayedPerTurn
Definition GameRules.h:129
the type of elements in a basic_json container
Definition GameObject.h:37