Blackjack++
  Deck class  

Deck class


void shuffle()

Public function.
Clears the deck and randomizes a new deck of 52 numbers.

int getCard()

Public function.
Returns the card ID of the card on the top of the deck. Removes the card from the deck.
If the deck has no cards remaining, returns -1.

Deck()

Public constructor.
Populates the deck with the cards in sequential order, Ace to King, Spades->Hearts->Clubs->Diamonds (King of Diamonds on top, Ace of Spades on bottom).
Call shuffle() before using deck.

~Deck()

Default destructor. No explicit function.

bool contains(int)

Private function.
Returns true if the Deck contains the given card ID (represented by 1-52). False if not.
Stephen Cole - Pitt Community College - December 2006