com.gbayer.basicblackjack
Class Deck

java.lang.Object
  extended by com.gbayer.basicblackjack.Deck

public class Deck
extends java.lang.Object

A Deck of Cards in play for the current Game.


Field Summary
static int LOW_DECK_SIZE
          Constant - Size of deck at which a dealer might want to swap in a new deck.
static int STANDARD_DECK_SIZE
          Constant - Size of one deck.
 
Constructor Summary
Deck()
          Instantiates a new deck.
Deck(int deckSize)
          Instantiates a new deck.
 
Method Summary
 void newDeck()
          Clear existing deck and generate/shuffle a new one.
 int numCardsRemaining()
          Count number of cards remaining.
 Card removeCard()
          Removes a card off the top of the deck.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STANDARD_DECK_SIZE

public static final int STANDARD_DECK_SIZE
Constant - Size of one deck.

See Also:
Constant Field Values

LOW_DECK_SIZE

public static final int LOW_DECK_SIZE
Constant - Size of deck at which a dealer might want to swap in a new deck.

See Also:
Constant Field Values
Constructor Detail

Deck

public Deck()
Instantiates a new deck.


Deck

public Deck(int deckSize)
Instantiates a new deck.

Parameters:
deckSize - the deck size
Method Detail

newDeck

public void newDeck()
Clear existing deck and generate/shuffle a new one. Reuses underlying data structure.


removeCard

public Card removeCard()
Removes a card off the top of the deck.

Returns:
the card

numCardsRemaining

public int numCardsRemaining()
Count number of cards remaining.

Returns:
the number of cards remaining.