Private Attributes |
card * | _cards [MAX_CARDS_IN_HAND] |
int | _score |
int | _count |
Constructor & Destructor Documentation
blackjack_hand::blackjack_hand |
( |
| ) |
|
Initialise the blackjack hand
Member Function Documentation
void blackjack_hand::add_card |
( |
card * |
card | ) |
|
Add a new card to the hand. If the hand is full and cannot take any more cards this method silently fails
- Parameters
-
card | the card object to add to the hand |
card * blackjack_hand::card_at |
( |
int |
idx | ) |
|
Get a pointer to a card in the hand
- Parameters
-
- Returns
- the card pointer, or NULL if that index has no card
void blackjack_hand::evaluate |
( |
| ) |
|
|
private |
Calculates the score of the hand
int blackjack_hand::get_count |
( |
| ) |
|
Get the number of cards in the hand
- Returns
- number of cards in the hand
int blackjack_hand::get_score |
( |
| ) |
|
Get the hand score
- Returns
- the hand score
bool blackjack_hand::is_blackjack |
( |
| ) |
|
Check if the hand has blackjack
- Returns
- if the hand has blackjack
bool blackjack_hand::is_busted |
( |
| ) |
|
Check if the hand is bust
- Returns
- if the hand is bust
bool blackjack_hand::is_full |
( |
| ) |
|
Check if the hand is full (ie. cannot take any more cards)
- Returns
- if the hand is full
bool blackjack_hand::needs_evaluate |
( |
| ) |
|
|
private |
Checks if the hand needs evaluating
- Returns
- boolean true/false
void blackjack_hand::return_cards |
( |
| ) |
|
Removes all cards from its cards field, sets count to 0
void blackjack_hand::reveal |
( |
| ) |
|
string blackjack_hand::str |
( |
| ) |
|
Creates a string representation of the blackjack hand
- Returns
- a string representation of the blackjack hand
The documentation for this class was generated from the following files: