41struct ScoringCalculatorContext;
50#pragma region static_functions
70#pragma region overridden_functions
74 return std::make_unique<Scoring>(*
this);
81 auto onUpdate(
float dt) ->
void override;
87 auto onSceneStart(
const std::string& sceneName) ->
void override;
88 auto load(
const Stream& stream) ->
void override;
89 auto save(
Stream& stream)
const ->
void override;
95#pragma region scoring_functions
108 auto scoringFeedback(std::vector<CategorizedHand> handsToHighlight) -> void;
140#pragma region member_variables
143 std::ranlux24_base
randSeed{std::random_device()()};
167#pragma region helper_functions
192 Entity* cardParent,
bool isImportant,
float cardTime,
float ratioThroughContributingCards,
float cardsScored);
230#pragma region static_variables
236#pragma region Messages
sys::Json Stream
Definition AudioObject.h:20
Holds a hand after it has been ranked, storing both the entire hand and the important cards.
The system responsible for keeping track of the rules the players want to have for their game.
Component that is responsible for managing the gameplay board, where cards are placed by Players.
Definition Board.h:38
friend Entity
Definition GameObject.h:90
GameObject(std::string typeName, gobj::Type parentType, gobj::Type type)
constructor for gameobject.
Definition GameObject.cpp:24
Type
Definition System.h:20
@ Scoring
Definition System.h:30
System(const std::string &typeName, Type systemType)
Definition System.cpp:75
Definition GameRules.h:29
Definition PlayerTurn.h:40
auto playAudioPerCard(const CardScoredMessage *cardScoredMessage) -> void
helper function for receiveCardScoredMiddle, plays sfx on each card scoring
Definition Scoring.cpp:1163
PlayerTurn * playerTurn
Definition Scoring.h:147
auto operator=(Scoring &&other) noexcept -> Scoring &=default
auto addScoringCalculatorStars(const CategorizedHand ¤tHand) -> void
Finds the first transparent star sequentially and colors it to the hand type.
Definition Scoring.cpp:973
std::string handScoredSFX
the audio file to play at the beginning of each hand scored
Definition Scoring.h:163
auto receiveCardScoredMiddle(const Message *message) -> Message
receive when a card is scored, to play an sfx on score, and maybe later to rotate a bit
Definition Scoring.cpp:1178
auto load(const Stream &stream) -> void override
Implementations will load the state of a GameObject from a th::Json Object.
Definition Scoring.cpp:294
auto linkMessages() -> void
Definition Scoring.cpp:1151
~Scoring() override
Definition Scoring.cpp:244
float maxPitch
the pitch that audio will max out at (won't actually hit this value, will get to approximately 75% of...
Definition Scoring.h:156
float extraPitchPerCard
how much to pitch up between cards scoring
Definition Scoring.h:159
void sendHandScoredEvent(ScoringFeedbackContext &sfcRef, Card *card)
create actions that send an event that happens at the first "wait" time of a hand being scored
Definition Scoring.cpp:775
static auto getEnum() -> Type
function required by all systems
Definition Scoring.h:55
float minPitch
the sound pitch sounds should start at
Definition Scoring.h:153
Scoring(const Scoring &other)=default
auto receiveHandScored(const Message *message) -> Message
receives when a hand of cards is scored, plays an audio effect
Definition Scoring.cpp:1195
auto turnOffScoringCalculator() -> void
Moves players up, disables scoring calculator, and resets to default visuals.
Definition Scoring.cpp:631
auto scoreBoard(Board &board, const std::vector< Card * > &cards) -> int
Checks all played cards and gets the hands.
Definition Scoring.cpp:313
auto playAudioPerHand(const CardScoredMessage *cardScoredMessage) -> void
helper function for recieveHandScored, plays a single audio effect per hand
Definition Scoring.cpp:1185
auto turnOffScoringCalculatorWithoutMovingPlayers() -> void
Disables scoring calculator without moving players up.
Definition Scoring.cpp:641
bool scoringFeedbackActive
Definition Scoring.h:150
auto systemShowMenu() -> void override
Specific systems should override this function to show their specific menu for the system.
Definition Scoring.cpp:267
auto highlightStar(const CategorizedHand ¤tHand) -> void
Intended for scoring calculator, which highlights all stars in a hand.
Definition Scoring.cpp:1030
GameRules * gameRules
Definition Scoring.h:146
Scoring()
Definition Scoring.cpp:237
std::ranlux24_base randSeed
Definition Scoring.h:143
auto scoringFeedback(std::vector< CategorizedHand > handsToHighlight) -> void
Highlights hands sequentially, being given them by scoring.
Definition Scoring.cpp:357
auto clearScoringCalculator() -> void
Handles the backend logic of turning off the scoring calculator.
Definition Scoring.cpp:1117
auto scoringFeedbackSetUp(std::vector< CategorizedHand > &handsToHighlight) -> int
Checks if hands evaluate at 0, makes selector invisible, and disables inputs.
Definition Scoring.cpp:686
auto turnOnScoringCalculator() -> void
Performs visual effects and adding star children to board when enabled.
Definition Scoring.cpp:572
auto endWindow() -> void override
currently unused, but intended to but was assumed to be necessary for a proper ImGui editor
Definition Scoring.h:83
auto scoringFeedbackDelayedFunction(float setInitialDelay) -> void
Calls all delayed actions at the end of scoring feedback, such as enabling feedback,...
Definition Scoring.cpp:934
auto scoringCalculatorHighlighting() -> void
Highlights stars while scoring calculator is enabled and players are moving through the board.
Definition Scoring.cpp:646
auto save(Stream &stream) const -> void override
Implementations will load the state of a GameObject to a th::Json object.
Definition Scoring.cpp:299
auto clone() const -> std::unique_ptr< GameObject > override
makes a copy a GameObject even if it's held polymorphically
Definition Scoring.h:72
auto onSceneStart(const std::string &sceneName) -> void override
Hook that is called before the first frame a scene is run, but after the entire scene is loaded into ...
Definition Scoring.cpp:282
auto operator=(const Scoring &other) -> Scoring &
Definition Scoring.cpp:254
auto onEnterEngine() -> void override
hook that is called when a GameObject enters the Engine tree.
Definition Scoring.cpp:304
auto isScoringFeedbackHappening() const -> bool
Returns if there are scoring feedback visuals currently on screen.
Definition Scoring.cpp:681
Table * table
Definition Scoring.h:145
auto onRender() -> void override
called every frame after update has been called for every object.
Definition Scoring.cpp:278
void createActionsForCardScoredEvents(ScoringFeedbackContext &context, const Card *currPlayedCard, Entity *cardParent, bool isImportant, float cardTime, float ratioThroughContributingCards, float cardsScored)
create actions that send 3 events for a scored card.
Definition Scoring.cpp:729
std::string cardScoredSFX
the audio file to play when each card is scored
Definition Scoring.h:161
auto onUpdate(float dt) -> void override
called once every frame.
Definition Scoring.cpp:273
auto createCardActions(ScoringFeedbackContext &sfcRef, ScoringFeedbackActions &sfaRef, const CategorizedHand ¤tPlayerHand) -> void
Adds all actions to individual cards, including scaling, highlighting, and transform.
Definition Scoring.cpp:787
The system responsible for facilitating communication between gameplay components (Players,...
Definition Table.h:48
the type of elements in a basic_json container
Definition GameObject.h:37
Definition CardScoredMessage.h:15
Definition CategorizedHand.h:32
Definition Scoring.cpp:148
Definition Scoring.cpp:56