43 auto
onUpdate(
float dt) ->
void override;
51 auto save(
Stream& stream)
const ->
void override;
sys::Json Stream
Definition AudioObject.h:20
The card component that is moved around on the board.
The base class for components, holding all of their shared All components should inherit from this.
Component that represents a deck of playing cards.
nlohmann::json json
Definition Json.cpp:19
Component(ComponentTypeEnum type, const char *typeName)
Definition Component.cpp:72
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
~Player() override=default
auto load(Stream &stream) -> void override
Implementations will load the state of a GameObject from a th::Json Object.
Definition Player.cpp:63
auto componentShowMenu() -> void override
Definition Player.cpp:88
auto hasCards() const -> bool
Returns if the player has any cards in their hand or not.
Definition Player.cpp:133
auto onRender() -> void override
called every frame after update has been called for every object.
Definition Player.cpp:59
auto addCardToHand(std::unique_ptr< Card > drawnCard) -> void
Creates a card entity and adds it to the hand.
Definition Player.cpp:99
auto decrementNumberofCards() -> void
Public function so Table can tell the player when they lose a card.
Definition Player.cpp:128
auto createCardToMenu(std::unique_ptr< Card > drawnCard) -> void
Actually handles the logic of creating a playing card Entity and adding it to the hand.
Definition Player.cpp:138
auto operator=(const Player &other) -> Player &=default
auto getNumberOfCardsInHand() const -> int
Returns the number of cards the player is holding.
Definition Player.cpp:105
auto endWindow() -> void override
currently unused, but intended to but was assumed to be necessary for a proper ImGui editor
Definition Player.h:47
Player(const Player &other)=default
auto clearHand() -> void
Gets rid of all the cards in the players hand.
Definition Player.cpp:110
int numberOfCardsInHand
The number of cards the player is holding.
Definition Player.h:76
auto onUpdate(float dt) -> void override
called once every frame.
Definition Player.cpp:55
friend auto to_json(json &j, const Player &p) -> void
Definition Player.cpp:74
Player(Player &&other) noexcept=default
auto operator=(Player &&other) -> Player &=default
auto save(Stream &stream) const -> void override
Implementations will load the state of a GameObject to a th::Json object.
Definition Player.cpp:68
friend auto from_json(const json &j, Player &p) -> void
Definition Player.cpp:82
auto clone() const -> std::unique_ptr< GameObject > override
makes a copy a GameObject even if it's held polymorphically
Definition Player.cpp:50
Player()
Definition Player.cpp:41