|
-footer | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectgarrettsmith.blackjack.Blackjack
public class Blackjack
Provides for playing a game of blackjack.
| Constructor Summary | |
|---|---|
Blackjack()
Creates a new Blackjack game simulator with the default Rules. |
|
Blackjack(Rules rules)
Creates a new Blackjack simulator with the specified Rules. |
|
| Method Summary | |
|---|---|
static int |
calculateBestValue(CardList cards)
Calculates the highest possible value for a list of cards without busting, if possible. |
static int |
calculateValue(Card card)
Calculates the value of a playing card according to the rules of Blackjack; assumes all aces are worth 1. |
static int |
calculateValue(CardList cards)
Calculates the value of a list of cards according to the rules of Blackjack; assumes all aces are worth 1. |
Rules |
getRules()
Returns the current Rules being used. |
static boolean |
isBlackjack(CardList cards)
Returns whether the list of cards passed in represents a blackjack. |
static boolean |
isNonAceFaceCard(Card card)
Returns whether the card passed in is a non-Ace face card: a ten, jack, queen, or king. |
static boolean |
isSoft(CardList cards)
Returns whether the list of cards is a soft hand. |
void |
playGame(EventHandler handler,
double wager)
Plays one game of blackjack betting wager and using handler
to determine how the player's hand is played. |
void |
setRules(Rules rules)
Sets the rules used to determine how the game is handled. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Blackjack()
Rules.
public Blackjack(Rules rules)
Rules.
rules - specifying which rules this simulator will follow| Method Detail |
|---|
public static int calculateBestValue(CardList cards)
public static int calculateValue(Card card)
public static int calculateValue(CardList cards)
public Rules getRules()
Rules being used.
public static boolean isNonAceFaceCard(Card card)
public static boolean isBlackjack(CardList cards)
public static boolean isSoft(CardList cards)
public void playGame(EventHandler handler,
double wager)
wager and using handler
to determine how the player's hand is played.
public void setRules(Rules rules)
|
-footer | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||