Blackjack Program  Iteration 2
Core Exercise HIT3172
 All Classes Functions Variables Enumerations Enumerator
Public Member Functions | Private Member Functions | Private Attributes | List of all members
blackjack_game Class Reference

Public Member Functions

 blackjack_game ()
 ~blackjack_game ()
void start ()
void hit ()
void stand ()
blackjack_handdealer ()
blackjack_handcurrent_player ()
bool player_won ()

Private Member Functions

void deal_card_to (blackjack_hand *hand, bool flip)

Private Attributes

deck_deck
blackjack_hand_player_hand
blackjack_hand_dealer_hand

Constructor & Destructor Documentation

blackjack_game::blackjack_game ( )

Initialise the blackjack game object

blackjack_game::~blackjack_game ( )

Delete the hands and the deck when the game object is destroyed

Member Function Documentation

blackjack_hand * blackjack_game::current_player ( )

Gets the players hand object

Returns
void blackjack_game::deal_card_to ( blackjack_hand hand,
bool  flip 
)
private

Deal a card to the hand

Parameters
handthe hand to deal to
flipwhether to deal it face up (true) or face down
blackjack_hand * blackjack_game::dealer ( )

Gets the dealers hand object

Returns
void blackjack_game::hit ( )

Gives the player a new card

bool blackjack_game::player_won ( )

Checks if the player won

Returns
void blackjack_game::stand ( )

Ends the players turn, the dealer then tries to match their score

void blackjack_game::start ( )

Starts a new blackjack game, returns cards, shuffles the deck and deals new cards to the player and dealer


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