Package com.shr4pnel.casino.base
Class Deck
java.lang.Object
com.shr4pnel.casino.base.Deck
- Direct Known Subclasses:
BlackjackDeck
Base class for all Decks of cards
Constructors should be created on a per implementation basis
- Since:
- 0.1.0
- See Also:
-
Field Details
-
cards
-
suitList
-
cardTypeList
-
cardValueList
protected final int[] cardValueList
-
-
Constructor Details
-
Deck
public Deck()
-
-
Method Details
-
shuffle
public void shuffle() -
drawCard
Draw a card from the top of the stack- Returns:
- A card, or null if the deck is empty
-
drawCards
Draw a variable number of cards- Parameters:
n- The number of cards to draw- Returns:
- An array of cards, or null if less than one, or more than the length of the deck
-
isEmpty
public boolean isEmpty()Check if the deck is emptyThis is a better alternative to waiting for a null return from drawCard(s)
- Returns:
- true, if the deck is empty
-