37 std::vector<PlayingCard> deck;
39 std::vector<PlayingCard> hand;
55 Player(
int hitPoints,
int maxHitPoints,
size_t handSize,
const std::vector<PlayingCard> &deck);
95 std::vector<PlayingCard>
getHand();
106 void setHand(
const std::vector<PlayingCard> &hand);
127 std::vector<PlayingCard>
getDeck();
134 void setDeck(
const std::vector<PlayingCard> &deck);
176 void heal(
int amount);
Class that represents a Player.
Definition: player.h:28
int getMaxHitPoints()
Returns the max hit points of the player.
Definition: player.cpp:50
void printHand()
Prints the hand of the player to std::cout.
Definition: player.cpp:146
void setHitPoints(int value)
Sets the current hit points of the player.
Definition: player.cpp:45
void removeCard(PlayingCard &card)
Removes the given card from the player's hand.
Definition: player.cpp:92
int getHitPoints()
Returns the current hit points of the player.
Definition: player.cpp:40
void setHandSize(size_t handSize)
Sets the hand size of the player.
Definition: player.cpp:77
std::vector< PlayingCard > getHand()
Returns the player's hand.
Definition: player.cpp:62
PlayingCard getCard(int index)
Returns the PlayingCard object that corresponds to the index given.
Definition: player.cpp:111
void heal(int amount)
Heals the player a given amount.
Definition: player.cpp:126
void setHand(const std::vector< PlayingCard > &hand)
Set the player's hand.
Definition: player.cpp:67
void setDeck(const std::vector< PlayingCard > &deck)
Set the Deck of the player.
Definition: player.cpp:87
void damage(int amount)
Applies damage equal to amount to the player.
Definition: player.cpp:118
std::vector< PlayingCard > getDeck()
Get the Deck of the player.
Definition: player.cpp:82
size_t getHandSize()
Returns the hand size of the player.
Definition: player.cpp:72
void setMaxHitPoints(int value)
Sets the maximum hit points of the player.
Definition: player.cpp:55
void addCard(PlayingCard &card)
Adds the given card to the player's hand.
Definition: player.cpp:106
std::string toString()
Converts the player object to a string.
Definition: player.cpp:140
void drawCard()
Draws a card from the player's deck and adds it to the player's hand.
Definition: player.cpp:30
Player()
Construct a new Player object.
Definition: player.cpp:13
Class to define the playing card object.
Definition: playing_card.h:24
This file defines the classes and methods used for a Playing Card.
Contains useful helper functions.