50#pragma region static_functions
68#pragma region overriden_functions
72 return std::make_unique<Table>(*
this);
77 auto onUpdate(
float dt) ->
void override;
83 auto onSceneStart(
const std::string& sceneName) ->
void override;
84 auto onSceneExit(
const std::string& sceneName) ->
void override;
86 auto load(
const Stream& stream) ->
void override;
87 auto save(
Stream& stream)
const ->
void override;
92#pragma region Table_functions
259#pragma region member_variables
295#pragma region helper_functions
385 auto
playCardOnBoard(
Card* cardToPlay, const std::pair<
int,
int>& positionOnBoard) ->
void;
389#pragma region messaging_functions
435#pragma region static_variables
sys::Json Stream
Definition AudioObject.h:20
Component that is responsible for managing the gameplay board, where cards are placed by Players.
The system that handles gameplay functions to communicate back to Table.
The component responsible for storing information relevant to the player.
System that can get the score of a board.
Component that is responsible for managing the gameplay board, where cards are placed by Players.
Definition Board.h:38
Component that represents a deck of playing cards.
Definition Deck.h:31
friend Entity
Definition GameObject.h:90
GameObject(std::string typeName, gobj::Type parentType, gobj::Type type)
constructor for gameobject.
Definition GameObject.cpp:24
Definition HandRating.h:30
The component responsible for storing information relevant to the player.
Definition Player.h:31
Type
Definition System.h:20
@ Table
Definition System.h:33
System(const std::string &typeName, Type systemType)
Definition System.cpp:75
Definition GameRules.h:29
Definition PlayerTurn.h:40
Component that is responsible for managing the gameplay board, where cards are placed by Players.
Definition Scoring.h:48
The system responsible for facilitating communication between gameplay components (Players,...
Definition Table.h:48
auto moveSelectorToBoard() -> void
Moves selector to the board. Used when a card is selected in a players hand.
Definition Table.cpp:784
Deck * deck
We cache the deck so we don't need to get it all the time.
Definition Table.h:271
auto getCurrentlyHoveredCard() const -> Card *
Gets the card that the Selector is currently hovering over if the Selector in hand.
Definition Table.cpp:850
auto moveSelectorToPlayer(int playerNumber) -> void
Moves the selector to a player based on their index in the players vector.
Definition Table.cpp:805
~Table() override=default
auto getDisabledFilter() -> bool
Checks if the filtered selector is disabled.
Definition Table.cpp:1244
auto updateCardsInDeckText() const -> void
Updates the text on screen to be the size of the Deck.
Definition Table.cpp:892
auto reloadBoard() -> void
Gets the pointer to the board component for "board" in the cache.
Definition Table.cpp:1164
auto handPopUpPushBack(HandRating::HandType typeOfHand) -> void
Automatically adds and adjusts player positions according to the count given in PlayerCountScene.
Definition Table.cpp:1124
auto receiveCardSelected(const Message *message) -> Message
Moves the selector from the player hand to the board.
Definition Table.cpp:1312
auto save(Stream &stream) const -> void override
Implementations will load the state of a GameObject to a th::Json object.
Definition Table.cpp:296
auto disableFilteredSelector() -> void
Calls disableFilter, which then returns all inputs as valid.
Definition Table.cpp:1603
auto reloadPlayers() -> void
Gets all the pointers of the Player components for "players" in the cache.
Definition Table.cpp:1142
Scoring * scoring
A cache of Scoring so we can call its functions.
Definition Table.h:264
auto getInBoard() -> bool
Gets if the player is in board right now.
Definition Table.cpp:760
auto receivePlayerTimerRanOut(const Message *message) -> Message
Informs playerTurn that a player has run out of time.
Definition Table.cpp:1444
auto setInBoard(bool setInBoard) -> void
Sets inBoard to either true or false.
Definition Table.cpp:765
auto disableHelpPopUp() -> void
Definition Table.cpp:1038
PlayerTurn * playerTurn
A cache of PlayerTurn so we can call its functions.
Definition Table.h:262
auto disableGameplayInput() -> void
Disables gameplay input (turns off messaging for the selector and table).
Definition Table.cpp:1061
auto movePlayerCardsDown(float cardDelay, Player *currentPlayer) const -> void
Moves the current players cards down and makes them gray.
Definition Table.cpp:537
auto reloadSelector() -> void
Gets the pointer to the selector entity being used for gameplay for the cache Currently checks player...
Definition Table.cpp:1175
auto getDisabledInput() const -> bool
Checks if the gameplay input is disabled.
Definition Table.cpp:1009
auto clone() const -> std::unique_ptr< GameObject > override
makes a copy a GameObject even if it's held polymorphically
Definition Table.h:70
auto pauseCurrentPlayerTimer() const -> void
Pauses the timer for the current player.
Definition Table.cpp:1069
auto fillAllPlayerHands() -> void
Tells all players to fill their hands until they reach the limit.
Definition Table.cpp:337
auto moveSelectorToCurrentPlayer() -> void
Moves the selector to the current player, as decided by PlayerTurn.
Definition Table.cpp:800
auto receiveGoToWinScreen(const Message *message) -> Message
Cheat code that ends the game immediately and goes to the win screen.
Definition Table.cpp:1589
auto moveAllPlayersToNormalPosition(float delayAmount) const -> void
Moves all current players to where.
Definition Table.cpp:658
auto destroyHandPopUp() -> void
Destroys the hand type pop up during scoring feedback.
Definition Table.cpp:995
auto unpauseCurrentPlayerTimer() const -> void
Pauses the timer for the current player.
Definition Table.cpp:1074
auto updatePlayerScoreText(int playerNumber) -> void
Updates the text displayed for a players score.
Definition Table.cpp:860
auto moveAllPlayersOffscreen(float delayAmount) const -> void
Moves all the players away from the center of the screen.
Definition Table.cpp:723
auto receiveAddScore(const Message *message) -> Message
Cheat code that adds score to the current player.
Definition Table.cpp:1574
auto onSceneExit(const std::string &sceneName) -> void override
Hook that is called right before a scene is unloaded To receive the hook, simply override the functio...
Definition Table.cpp:275
auto reloadCache() -> void
Re-gets the players, board, and deck pointers.
Definition Table.cpp:305
auto adjustPlayers() -> void
Automatically adds and adjusts player positions according to the count given in PlayerCountScene.
Definition Table.cpp:900
auto systemShowMenu() -> void override
Specific systems should override this function to show their specific menu for the system.
Definition Table.cpp:165
GameRules * gameRules
Ruleset to follow for things like cards in hand, size of board, etc.
Definition Table.h:278
auto receiveRightKeyPressed(const Message *message) -> Message
Definition Table.cpp:1505
auto onUpdate(float dt) -> void override
called once every frame.
Definition Table.cpp:197
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 Table.cpp:208
auto updateHandPopText(HandRating::HandType typeOfHand, int amount) -> void
Automatically adds and adjusts player positions according to the count given in PlayerCountScene.
Definition Table.cpp:1107
friend class PlayerTurn
Definition Table.h:438
auto undoLastPlayedCard() const -> void
Returns the last played card on the board to the current players hand, and decrements cardsPlayedThis...
Definition Table.cpp:1625
auto linkMessages() -> void
Definition Table.cpp:1680
auto moveAllPlayerCardsDown(float delayAmount) const -> void
Moves all the players away from the center of the screen.
Definition Table.cpp:687
auto receiveUpKeyPressed(const Message *message) -> Message
Definition Table.cpp:1528
auto operator=(Table &&other) noexcept -> Table &=default
auto dealCardToPlayer(int playerNumber) -> void
Draws a card from the deck and gives it to the player.
Definition Table.cpp:313
bool filterDisabled
Bool that keeps track of the filter for the selector is disabled.
Definition Table.h:284
bool inputDisabled
Bool that keeps track of if the table and selector should receive input.
Definition Table.h:291
auto setInputID(int id) const -> void
Updates the filter in the selector in the scene to a new value.
Definition Table.cpp:770
auto updateScoreText(int newScore) -> void
Updates the current player's score text, but doesn't actually change the value.
Definition Table.cpp:1608
auto receiveCardPlayedOnBoard(const Message *message) -> Message
Moves the selector back to the player hand, unless it is the next players turn.
Definition Table.cpp:1376
auto receiveRedo(const Message *message) -> Message
Moves the last undone card back to where it was played.
Definition Table.cpp:1360
auto grayCurrentTimer() const -> void
Makes the current players timer gray.
Definition Table.cpp:1079
auto hideDeckCount() const -> void
Makes the deck count go invisible.
Definition Table.cpp:1095
auto unHighlightPlayedCards() const -> void
Removes the highlighting effect of the cards that were played this turn.
Definition Table.cpp:1001
std::vector< Player * > players
We cache the players so we don't need to get it all the time.
Definition Table.h:267
auto receiveEndTurn(const Message *message) -> Message
Ends the current player's turn.
Definition Table.cpp:1388
Board * board
We cache the board so we don't need to get it all the time.
Definition Table.h:269
auto fillPlayerHand(Player *player) -> void
Tells a player to draw cards until their hand is full.
Definition Table.cpp:326
auto playCardOnBoard(Card *cardToPlay, const std::pair< int, int > &positionOnBoard) -> void
Handles the entire in-engine process of playing a card on a board and visually moving it there.
Definition Table.cpp:1249
auto moveSelectorToLastSelectedCard() -> void
Moves the selector to lastSelectedCard, which is set every time a card is selected in a players hand.
Definition Table.cpp:824
auto resetTable() -> void
Resets everything on the table to the start of a new round.
Definition Table.cpp:1227
auto enableHelpPopUp() -> void
Definition Table.cpp:1022
auto moveSelectorToLastSelectedTile() -> void
Moves the selector to the last selected tile, which is set every time a card is played on the board.
Definition Table.cpp:837
auto completelyHideSelector() const -> void
Hides the selector and makes it stop emitting particles.
Definition Table.cpp:1100
static auto getEnum() -> Type
function required by all systems
Definition Table.h:54
Entity * lastSelectedTile
Tracker of the last selected board tile, so the player doesn't start in the bottom left every time.
Definition Table.h:275
auto onRender() -> void override
called every frame after update has been called for every object.
Definition Table.cpp:204
auto getSelector() const -> Entity *
Gets selector variable.
Definition Table.cpp:1222
auto load(const Stream &stream) -> void override
Implementations will load the state of a GameObject from a th::Json Object.
Definition Table.cpp:291
auto movePlayerCardsUp(float cardDelay, Player *currentPlayer) const -> void
Moves the current players cards up and highlights them.
Definition Table.cpp:419
auto receiveDrawCard(const Message *message) -> Message
Cheat code that draws a card to the current player.
Definition Table.cpp:1581
auto playerScoreEffects() -> void
Adds a popping and highlighting effect to the player score.
Definition Table.cpp:867
auto receiveUndo(const Message *message) -> Message
Moves the last played card from the board to the players hand.
Definition Table.cpp:1344
auto reloadDeck() -> void
Gets the pointer to the deck component for "deck" in the cache.
Definition Table.cpp:1170
auto checkValidInputID(int id) const -> bool
Checks if a passed in ID matches the filter inside the FilteredSelector.
Definition Table.cpp:779
auto receiveScoreCalculator(const Message *message) -> Message
Toggles the scoring calculator.
Definition Table.cpp:1423
auto receiveLeftKeyPressed(const Message *message) -> Message
Definition Table.cpp:1481
auto receiveHelp(const Message *message) -> Message
Enables/Disables help popup.
Definition Table.cpp:1462
Table()
Definition Table.cpp:138
Entity * selector
We cache the Selector so we don't need to get it all the time.
Definition Table.h:273
auto receiveResetTable(const Message *message) -> Message
Resets the table to prepare it for a new game.
Definition Table.cpp:1305
bool inBoard
Bool that keeps track of if the player is in board. Used by score calculator.
Definition Table.h:281
auto receiveDownKeyPressed(const Message *message) -> Message
Definition Table.cpp:1551
auto updateCardsPlayedText() -> void
Sets the text on screen to match the "numberOfCardsPlayedThisTurn" variable.
Definition Table.cpp:883
auto endWindow() -> void override
currently unused, but intended to but was assumed to be necessary for a proper ImGui editor
Definition Table.h:79
auto operator=(const Table &) -> Table &=default
auto receiveDeselect(const Message *message) -> Message
Moves the selector from the board to the player hand.
Definition Table.cpp:1326
auto enableGameplayInput() -> void
Enables gameplay input (allows messaging for the selector and table).
Definition Table.cpp:1014
the type of elements in a basic_json container
Definition GameObject.h:37