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
260#pragma region member_variables
296#pragma region helper_functions
386 auto
playCardOnBoard(
Card* cardToPlay, const std::pair<
int,
int>& positionOnBoard) ->
void;
390#pragma region messaging_functions
436#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:785
Deck * deck
We cache the deck so we don't need to get it all the time.
Definition Table.h:272
auto getCurrentlyHoveredCard() const -> Card *
Gets the card that the Selector is currently hovering over if the Selector in hand.
Definition Table.cpp:851
auto moveSelectorToPlayer(int playerNumber) -> void
Moves the selector to a player based on their index in the players vector.
Definition Table.cpp:806
~Table() override=default
auto getDisabledFilter() -> bool
Checks if the filtered selector is disabled.
Definition Table.cpp:1250
auto updateCardsInDeckText() const -> void
Updates the text on screen to be the size of the Deck.
Definition Table.cpp:893
auto reloadBoard() -> void
Gets the pointer to the board component for "board" in the cache.
Definition Table.cpp:1170
auto handPopUpPushBack(HandRating::HandType typeOfHand) -> void
Automatically adds and adjusts player positions according to the count given in PlayerCountScene.
Definition Table.cpp:1130
auto receiveCardSelected(const Message *message) -> Message
Moves the selector from the player hand to the board.
Definition Table.cpp:1318
auto save(Stream &stream) const -> void override
Implementations will load the state of a GameObject to a th::Json object.
Definition Table.cpp:297
auto disableFilteredSelector() -> void
Calls disableFilter, which then returns all inputs as valid.
Definition Table.cpp:1604
auto reloadPlayers() -> void
Gets all the pointers of the Player components for "players" in the cache.
Definition Table.cpp:1148
Scoring * scoring
A cache of Scoring so we can call its functions.
Definition Table.h:265
auto getInBoard() -> bool
Gets if the player is in board right now.
Definition Table.cpp:761
auto receivePlayerTimerRanOut(const Message *message) -> Message
Informs playerTurn that a player has run out of time.
Definition Table.cpp:1449
auto setInBoard(bool setInBoard) -> void
Sets inBoard to either true or false.
Definition Table.cpp:766
PlayerTurn * playerTurn
A cache of PlayerTurn so we can call its functions.
Definition Table.h:263
auto disableGameplayInput() -> void
Disables gameplay input (turns off messaging for the selector and table).
Definition Table.cpp:1067
auto movePlayerCardsDown(float cardDelay, Player *currentPlayer) const -> void
Moves the current players cards down and makes them gray.
Definition Table.cpp:538
auto reloadSelector() -> void
Gets the pointer to the selector entity being used for gameplay for the cache Currently checks player...
Definition Table.cpp:1181
auto getDisabledInput() const -> bool
Checks if the gameplay input is disabled.
Definition Table.cpp:1010
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:1075
auto fillAllPlayerHands() -> void
Tells all players to fill their hands until they reach the limit.
Definition Table.cpp:338
auto moveSelectorToCurrentPlayer() -> void
Moves the selector to the current player, as decided by PlayerTurn.
Definition Table.cpp:801
auto receiveGoToWinScreen(const Message *message) -> Message
Cheat code that ends the game immediately and goes to the win screen.
Definition Table.cpp:1590
auto moveAllPlayersToNormalPosition(float delayAmount) const -> void
Moves all current players to where.
Definition Table.cpp:659
auto destroyHandPopUp() -> void
Destroys the hand type pop up during scoring feedback.
Definition Table.cpp:996
auto unpauseCurrentPlayerTimer() const -> void
Pauses the timer for the current player.
Definition Table.cpp:1080
auto updatePlayerScoreText(int playerNumber) -> void
Updates the text displayed for a players score.
Definition Table.cpp:861
auto moveAllPlayersOffscreen(float delayAmount) const -> void
Moves all the players away from the center of the screen.
Definition Table.cpp:724
auto receiveAddScore(const Message *message) -> Message
Cheat code that adds score to the current player.
Definition Table.cpp:1575
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:276
auto reloadCache() -> void
Re-gets the players, board, and deck pointers.
Definition Table.cpp:306
auto adjustPlayers() -> void
Automatically adds and adjusts player positions according to the count given in PlayerCountScene.
Definition Table.cpp:901
auto systemShowMenu() -> void override
Specific systems should override this function to show their specific menu for the system.
Definition Table.cpp:163
GameRules * gameRules
Ruleset to follow for things like cards in hand, size of board, etc.
Definition Table.h:279
auto receiveRightKeyPressed(const Message *message) -> Message
Definition Table.cpp:1506
auto onUpdate(float dt) -> void override
called once every frame.
Definition Table.cpp:195
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:206
auto updateHandPopText(HandRating::HandType typeOfHand, int amount) -> void
Automatically adds and adjusts player positions according to the count given in PlayerCountScene.
Definition Table.cpp:1113
friend class PlayerTurn
Definition Table.h:439
auto undoLastPlayedCard() const -> void
Returns the last played card on the board to the current players hand, and decrements cardsPlayedThis...
Definition Table.cpp:1626
auto linkMessages() -> void
Definition Table.cpp:1681
auto moveAllPlayerCardsDown(float delayAmount) const -> void
Moves all the players away from the center of the screen.
Definition Table.cpp:688
auto receiveUpKeyPressed(const Message *message) -> Message
Definition Table.cpp:1529
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:314
bool filterDisabled
Bool that keeps track of the filter for the selector is disabled.
Definition Table.h:285
bool inputDisabled
Bool that keeps track of if the table and selector should receive input.
Definition Table.h:292
auto setInputID(int id) const -> void
Updates the filter in the selector in the scene to a new value.
Definition Table.cpp:771
auto updateScoreText(int newScore) -> void
Updates the current player's score text, but doesn't actually change the value.
Definition Table.cpp:1609
auto receiveCardPlayedOnBoard(const Message *message) -> Message
Moves the selector back to the player hand, unless it is the next players turn.
Definition Table.cpp:1382
auto receiveRedo(const Message *message) -> Message
Moves the last undone card back to where it was played.
Definition Table.cpp:1366
auto grayCurrentTimer() const -> void
Makes the current players timer gray.
Definition Table.cpp:1085
auto hideDeckCount() const -> void
Makes the deck count go invisible.
Definition Table.cpp:1101
auto unHighlightPlayedCards() const -> void
Removes the highlighting effect of the cards that were played this turn.
Definition Table.cpp:1002
std::vector< Player * > players
We cache the players so we don't need to get it all the time.
Definition Table.h:268
auto receiveEndTurn(const Message *message) -> Message
Ends the current player's turn.
Definition Table.cpp:1393
Board * board
We cache the board so we don't need to get it all the time.
Definition Table.h:270
auto fillPlayerHand(Player *player) -> void
Tells a player to draw cards until their hand is full.
Definition Table.cpp:327
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:1255
auto moveSelectorToLastSelectedCard() -> void
Moves the selector to lastSelectedCard, which is set every time a card is selected in a players hand.
Definition Table.cpp:825
auto resetTable() -> void
Resets everything on the table to the start of a new round.
Definition Table.cpp:1233
auto enableHelpPopUp() -> void
Enables help menu.
Definition Table.cpp:1023
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:838
auto completelyHideSelector() const -> void
Hides the selector and makes it stop emitting particles.
Definition Table.cpp:1106
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:276
auto onRender() -> void override
called every frame after update has been called for every object.
Definition Table.cpp:202
auto getSelector() const -> Entity *
Gets selector variable.
Definition Table.cpp:1228
auto load(const Stream &stream) -> void override
Implementations will load the state of a GameObject from a th::Json Object.
Definition Table.cpp:292
auto movePlayerCardsUp(float cardDelay, Player *currentPlayer) const -> void
Moves the current players cards up and highlights them.
Definition Table.cpp:420
auto receiveDrawCard(const Message *message) -> Message
Cheat code that draws a card to the current player.
Definition Table.cpp:1582
auto playerScoreEffects() -> void
Adds a popping and highlighting effect to the player score.
Definition Table.cpp:868
auto receiveUndo(const Message *message) -> Message
Moves the last played card from the board to the players hand.
Definition Table.cpp:1350
auto reloadDeck() -> void
Gets the pointer to the deck component for "deck" in the cache.
Definition Table.cpp:1176
auto checkValidInputID(int id) const -> bool
Checks if a passed in ID matches the filter inside the FilteredSelector.
Definition Table.cpp:780
auto receiveScoreCalculator(const Message *message) -> Message
Toggles the scoring calculator.
Definition Table.cpp:1428
auto receiveLeftKeyPressed(const Message *message) -> Message
Definition Table.cpp:1482
auto receiveHelp(const Message *message) -> Message
Enables/Disables help popup.
Definition Table.cpp:1467
Table()
Definition Table.cpp:136
Entity * selector
We cache the Selector so we don't need to get it all the time.
Definition Table.h:274
auto receiveResetTable(const Message *message) -> Message
Resets the table to prepare it for a new game.
Definition Table.cpp:1311
bool inBoard
Bool that keeps track of if the player is in board. Used by score calculator.
Definition Table.h:282
auto receiveDownKeyPressed(const Message *message) -> Message
Definition Table.cpp:1552
auto updateCardsPlayedText() -> void
Sets the text on screen to match the "numberOfCardsPlayedThisTurn" variable.
Definition Table.cpp:884
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:1332
auto enableGameplayInput() -> void
Enables gameplay input (allows messaging for the selector and table).
Definition Table.cpp:1015
the type of elements in a basic_json container
Definition GameObject.h:37