Blackjack

com.amoebacode.blackjack.core
Class DeckFactory

java.lang.Object
  |
  +--com.amoebacode.blackjack.core.DeckFactory

public class DeckFactory
extends java.lang.Object

DeckFactory provides possible card values and shuffles new decks.

Version:
0.9
Author:
Jason Gurney

Field Summary
private static int[] SCORES
          The set of card scores
private static char[] SUITS
          The set of card suits
private static char[] VALUES
          The set of card values
 
Constructor Summary
private DeckFactory()
          Default private constructor - this class should not be instantiated.
 
Method Summary
static java.lang.String[] getCardValues()
          Returns an array of all possible card value-suit combinations.
private static void shuffleDealerAcesDeck(IDeck deck, int numberOfDecks)
          Fills the specified deck with a collection of dealer ace hands.
private static void shuffleDealerBlackjackDeck(IDeck deck, int numberOfDecks)
          Fills the specified deck with a collection of dealer blackjack hands.
protected static void shuffleDeck(IDeck deck, int numberOfDecks)
          Fills the specified deck with a newly shuffled collection of cards.
private static void shufflePlayerBlackjackDeck(IDeck deck, int numberOfDecks)
          Fills the specified deck with a collection of player blackjack hands.
private static void shuffleSevensDeck(IDeck deck, int numberOfDecks)
          Fills the specified deck with a collection of sevens.
private static void shuffleStandardDeck(IDeck deck, int numberOfDecks)
          Fills the specified deck with a newly shuffled standard collection of cards.
private static void shuffleThreesDeck(IDeck deck, int numberOfDecks)
          Fills the specified deck with a collection of threes.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

VALUES

private static final char[] VALUES
The set of card values

SCORES

private static final int[] SCORES
The set of card scores

SUITS

private static final char[] SUITS
The set of card suits
Constructor Detail

DeckFactory

private DeckFactory()
Default private constructor - this class should not be instantiated.
Method Detail

shuffleDeck

protected static void shuffleDeck(IDeck deck,
                                  int numberOfDecks)
Fills the specified deck with a newly shuffled collection of cards.
Parameters:
deck - the IDeck to shuffle
numberOfDecks - the number of decks to include

shuffleStandardDeck

private static void shuffleStandardDeck(IDeck deck,
                                        int numberOfDecks)
Fills the specified deck with a newly shuffled standard collection of cards.
Parameters:
deck - the IDeck to shuffle
numberOfDecks - the number of decks to include

shuffleSevensDeck

private static void shuffleSevensDeck(IDeck deck,
                                      int numberOfDecks)
Fills the specified deck with a collection of sevens.
Parameters:
deck - the IDeck to shuffle
numberOfDecks - the number of decks to include

shuffleThreesDeck

private static void shuffleThreesDeck(IDeck deck,
                                      int numberOfDecks)
Fills the specified deck with a collection of threes.
Parameters:
deck - the IDeck to shuffle
numberOfDecks - the number of decks to include

shuffleDealerBlackjackDeck

private static void shuffleDealerBlackjackDeck(IDeck deck,
                                               int numberOfDecks)
Fills the specified deck with a collection of dealer blackjack hands.
Parameters:
deck - the IDeck to shuffle
numberOfDecks - the number of decks to include

shufflePlayerBlackjackDeck

private static void shufflePlayerBlackjackDeck(IDeck deck,
                                               int numberOfDecks)
Fills the specified deck with a collection of player blackjack hands.
Parameters:
deck - the IDeck to shuffle
numberOfDecks - the number of decks to include

shuffleDealerAcesDeck

private static void shuffleDealerAcesDeck(IDeck deck,
                                          int numberOfDecks)
Fills the specified deck with a collection of dealer ace hands.
Parameters:
deck - the IDeck to shuffle
numberOfDecks - the number of decks to include

getCardValues

public static java.lang.String[] getCardValues()
Returns an array of all possible card value-suit combinations.
Returns:
a String array including all possible cards

Blackjack

Copyright © 2002 amoebacode.com.