Blackjack
Loading...
Searching...
No Matches
Public Member Functions | List of all members
Dealer Class Reference

#include <dealer.h>

Inheritance diagram for Dealer:
Player

Public Member Functions

 Dealer (const int playerLimit, const int dealerLimit)
 
void chance (Deck &deck) override
 Depending on the m_dealerLimit, the dealer can HIT or must STAND.
 
void hit (Deck &deck) override
 Compute the score based on the card the dealer gets.
 
- Public Member Functions inherited from Player
 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).
 

Additional Inherited Members

- Protected Attributes inherited from Player
std::string_view m_name {}
 
const int m_limit {}
 
int m_score {}
 
bool m_stand {}
 
bool m_busted {}
 
Outcome m_outcome {}
 

Constructor & Destructor Documentation

◆ Dealer()

Dealer::Dealer ( const int  playerLimit,
const int  dealerLimit 
)
inline

Member Function Documentation

◆ chance()

void Dealer::chance ( Deck deck)
overridevirtual

Depending on the m_dealerLimit, the dealer can HIT or must STAND.

Implements Player.

◆ hit()

void Dealer::hit ( Deck deck)
overridevirtual

Compute the score based on the card the dealer gets.

Parameters
deck

Implements Player.


The documentation for this class was generated from the following files: