A player is defined by the score that he earns through his chances, in which he can either hit or stand.
More...
#include <player.h>
|
| Player () |
|
| Player (std::string_view name, const int playerLimit) |
|
virtual | ~Player ()=default |
|
std::string_view | getName () const |
| Get the player's name.
|
|
int | getScore () const |
| Get the player's score.
|
|
bool | isBusted () const |
| Return if a player is busted.
|
|
bool | isStand () const |
| Return if a player STANDS.
|
|
void | setOutcome (Outcome outcome) |
| Set the player's outcome upon finishing the game.
|
|
Outcome | getOutcome () const |
| Get the outcome of the player's game.
|
|
void | reset () |
| Reset the scores and status of the players (to play another game)
|
|
virtual void | chance (Deck &deck)=0 |
| Defines the chance of a player.
|
|
virtual void | hit (Deck &deck)=0 |
| Defines the actions performed when a player HITS (as opposed to STANDS).
|
|
A player is defined by the score that he earns through his chances, in which he can either hit or stand.
◆ Player() [1/2]
◆ Player() [2/2]
Player::Player |
( |
std::string_view |
name, |
|
|
const int |
playerLimit |
|
) |
| |
|
inline |
◆ ~Player()
virtual Player::~Player |
( |
| ) |
|
|
virtualdefault |
◆ getName()
std::string_view Player::getName |
( |
| ) |
const |
|
inline |
Get the player's name.
- Returns
- std::string_view
◆ getScore()
int Player::getScore |
( |
| ) |
const |
|
inline |
Get the player's score.
- Returns
- int
◆ isBusted()
bool Player::isBusted |
( |
| ) |
const |
|
inline |
Return if a player is busted.
- Returns
- true : if the player's score has crossed the given limit
-
false : the player isn't busted yet
◆ isStand()
bool Player::isStand |
( |
| ) |
const |
|
inline |
Return if a player STANDS.
- Returns
- true : if the players STANDS
-
false : the player HITS
◆ setOutcome()
void Player::setOutcome |
( |
Outcome |
outcome | ) |
|
|
inline |
Set the player's outcome upon finishing the game.
- Parameters
-
◆ getOutcome()
Outcome Player::getOutcome |
( |
| ) |
const |
|
inline |
Get the outcome of the player's game.
- Returns
- Outcome
◆ reset()
Reset the scores and status of the players (to play another game)
◆ chance()
virtual void Player::chance |
( |
Deck & |
deck | ) |
|
|
pure virtual |
Defines the chance of a player.
- Parameters
-
Implemented in Dealer, and User.
◆ hit()
virtual void Player::hit |
( |
Deck & |
deck | ) |
|
|
pure virtual |
Defines the actions performed when a player HITS (as opposed to STANDS).
- Parameters
-
Implemented in Dealer, and User.
◆ m_name
std::string_view Player::m_name {} |
|
protected |
◆ m_limit
const int Player::m_limit {} |
|
protected |
◆ m_score
◆ m_stand
◆ m_busted
◆ m_outcome
The documentation for this class was generated from the following file: