49#pragma region static_functions
67#pragma region overriden_functions
71 return std::make_unique<Table>(*
this);
76 auto onUpdate(
float dt) ->
void override;
82 auto onSceneStart(
const std::string& sceneName) ->
void override;
83 auto onSceneExit(
const std::string& sceneName) ->
void override;
85 auto load(
const Stream& stream) ->
void override;
86 auto save(
Stream& stream)
const ->
void override;
91#pragma region Table_functions
141#pragma region member_variables
163#pragma region helper_functions
236#pragma region messaging_functions
264#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.
A helper struct that contains all relevant rules for gameplay for the Table.
The component responsible for storing information relevant to the player.
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:84
GameObject(std::string typeName, gobj::Type parentType, gobj::Type type)
constructor for gameobject.
Definition GameObject.cpp:23
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 PlayerTurn.h:36
The system responsible for facilitating communication between gameplay components (Players,...
Definition Table.h:47
auto moveSelectorToBoard() -> void
Moves selector to the board. Used when a card is selected in a players hand.
Definition Table.cpp:252
auto fillPlayerHand(int playerNumber) const -> void
Tells a player to draw cards until their hand is full.
Definition Table.cpp:211
Deck * deck
We cache the deck so we don't need to get it all the time.
Definition Table.h:151
auto moveSelectorToPlayer(int playerNumber) const -> void
Moves the selector to a player based on their index in the players vector.
Definition Table.cpp:268
~Table() override=default
auto updateCardsInDeckText() -> void
Updates the text on screen to be the size of the Deck.
Definition Table.cpp:327
auto reloadBoard() -> void
Gets the pointer to the board component for "board" in the cache.
Definition Table.cpp:427
auto receiveCardSelected(const Message *message) -> Message
Moves the selector from the player hand to the board.
Definition Table.cpp:495
auto save(Stream &stream) const -> void override
Implementations will load the state of a GameObject to a th::Json object.
Definition Table.cpp:182
auto reloadPlayers() -> void
Gets all the pointers of the Player components for "players" in the cache.
Definition Table.cpp:405
PlayerTurn * playerTurn
A cache of PlayerTurn so we can call its functions.
Definition Table.h:144
auto reloadSelector() -> void
Gets the pointer to the selector entity being used for gameplay for the cache Currently checks player...
Definition Table.cpp:438
auto clone() const -> std::unique_ptr< GameObject > override
makes a copy a GameObject even if it's held polymorphically
Definition Table.h:69
auto fillAllPlayerHands() -> void
Tells all players to fill their hands until they reach the limit.
Definition Table.cpp:229
auto receiveGoToWinScreen(const Message *message) -> Message
Cheat code that ends the game immediately and goes to the win screen.
Definition Table.cpp:553
auto updatePlayerScoreText(int playerNumber) -> void
Updates the text displayed for a players score.
Definition Table.cpp:311
auto receiveAddScore(const Message *message) -> Message
Cheat code that adds score to the current player.
Definition Table.cpp:539
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:162
auto reloadCache() -> void
Re-gets the players, board, and deck pointers.
Definition Table.cpp:191
auto adjustPlayers() -> void
Automatically adds and adjusts player positions according to the count given in PlayerCountScene.
Definition Table.cpp:335
auto systemShowMenu() -> void override
Specific systems should override this function to show their specific menu for the system.
Definition Table.cpp:88
auto onUpdate(float dt) -> void override
called once every frame.
Definition Table.cpp:120
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:129
friend class PlayerTurn
Definition Table.h:267
auto dealCardToPlayer(int playerNumber) const -> void
Draws a card from the deck and gives it to the player.
Definition Table.cpp:198
auto linkMessages() -> void
Definition Table.cpp:560
auto operator=(Table &&other) noexcept -> Table &=default
auto setInputID(int id) const -> void
Updates the filter in the selector in the scene to a new value.
Definition Table.cpp:242
auto receiveCardPlayedOnBoard(const Message *message) -> Message
Moves the selector back to the player hand, unless it is the next players turn.
Definition Table.cpp:514
std::vector< Player * > players
We cache the players so we don't need to get it all the time.
Definition Table.h:147
auto receiveEndTurn(const Message *message) -> Message
Ends the current player's turn.
Definition Table.cpp:526
Board * board
We cache the board so we don't need to get it all the time.
Definition Table.h:149
auto resetTable() -> void
Resets everything on the table to the start of a new round.
Definition Table.cpp:465
static auto getEnum() -> Type
function required by all systems
Definition Table.h:53
auto receiveCardDeselected(const Message *message) -> Message
Moves the selector from the board to the player hand.
Definition Table.cpp:507
Entity * lastSelectedTile
Tracker of the last selected board tile, so the player doesn't start in the bottom left every time.
Definition Table.h:156
auto onRender() -> void override
called every frame after update has been called for every object.
Definition Table.cpp:125
auto load(const Stream &stream) -> void override
Implementations will load the state of a GameObject from a th::Json Object.
Definition Table.cpp:177
auto receiveDrawCard(const Message *message) -> Message
Cheat code that draws a card to the current player.
Definition Table.cpp:546
auto reloadDeck() -> void
Gets the pointer to the deck component for "deck" in the cache.
Definition Table.cpp:433
auto setPlayerSize(int count) -> void
Sets player size, intended for PlayerCountScene to use.
Definition Table.cpp:237
auto moveSelectorToLastSelectedTile() const -> void
Moves the selector to the last selected tile, which is set every time a card is played on the board.
Definition Table.cpp:299
Table()
Definition Table.cpp:61
Entity * selector
We cache the Selector so we don't need to get it all the time.
Definition Table.h:153
auto receiveResetTable(const Message *message) -> Message
Resets the table to prepare it for a new game.
Definition Table.cpp:488
auto updateCardsPlayedText() -> void
Sets the text on screen to match the "numberOfCardsPlayedThisTurn" variable.
Definition Table.cpp:319
GameRules gameRules
Ruleset to follow for things like cards in hand, size of board, etc.
Definition Table.h:159
auto endWindow() -> void override
currently unused, but intended to but was assumed to be necessary for a proper ImGui editor
Definition Table.h:78
auto operator=(const Table &) -> Table &=default
auto moveSelectorToLastPlayedCard() const -> void
Moves the selector to lastSelectedCard, which is set every time a card is selected in a players hand.
Definition Table.cpp:287
the type of elements in a basic_json container
Definition GameObject.h:32
An indicator that loops through a parents' nodes children and can "select" them on keypress.
Definition GameRules.h:30