35 Player(std::string_view name,
const int playerLimit)
A player is defined by the score that he earns through his chances, in which he can either hit or sta...
Definition player.h:22
virtual void chance(Deck &deck)=0
Defines the chance of a player.
virtual ~Player()=default
bool m_busted
Definition player.h:28
void reset()
Reset the scores and status of the players (to play another game)
Definition player.h:107
void setOutcome(Outcome outcome)
Set the player's outcome upon finishing the game.
Definition player.h:88
Outcome getOutcome() const
Get the outcome of the player's game.
Definition player.h:98
bool isStand() const
Return if a player STANDS.
Definition player.h:78
const int m_limit
Definition player.h:25
virtual void hit(Deck &deck)=0
Defines the actions performed when a player HITS (as opposed to STANDS).
bool isBusted() const
Return if a player is busted.
Definition player.h:67
Outcome m_outcome
Definition player.h:29
int m_score
Definition player.h:26
int getScore() const
Get the player's score.
Definition player.h:56
std::string_view getName() const
Get the player's name.
Definition player.h:46
std::string_view m_name
Definition player.h:24
bool m_stand
Definition player.h:27
Player(std::string_view name, const int playerLimit)
Definition player.h:35
Player()
Definition player.h:32
Defines the possible Outcomes of the game.
Outcome
There are two possible outcomes: lose or win (no tie)
Definition outcome.h:18
@ LOSE
Definition outcome.h:19