Blackjack

com.amoebacode.blackjack.strategy
Class BasicStrategyServerUtil

java.lang.Object
  |
  +--com.amoebacode.blackjack.strategy.BasicStrategyServerUtil

abstract class BasicStrategyServerUtil
extends java.lang.Object

BasicStrategyServerUtil provides utility methods to the SOAP RPC-based basic strategy server.

Version:
0.9
Author:
Jason Gurney

Field Summary
private static java.lang.String[] CARDS
          The set of card values
protected static java.lang.String EARLY_SURRENDER_ARG
          The user argument that signifies early surrender availability
private static int[] HARD_CARD_SCORES
          The set of hard card scores
private static java.util.Map hardCardScores
          A collection mapping card values to hard card scores
protected static int MAXIMUM_HARD_CARD_SCORE
          The maximum hard score for a single card
protected static int MAXIMUM_SCORE
          The maximum score for a hand
protected static java.lang.String NO_DAS_ARG
          The user argument that signifies no doubling after a split
protected static java.lang.String ONE_DECK_ARG
          The user argument that signifies a one-deck shoe
protected static java.lang.String SIX_DECKS_ARG
          The user argument that signifies a six-deck shoe
private static int[] SOFT_CARD_SCORES
          The set of soft card scores
protected static java.lang.String SOFT_SEVENTEEN_ARG
          The user argument that signifies dealer hitting on soft seventeen
private static java.util.Map softCardScores
          A collection mapping card values to soft card scores
protected static java.lang.String TWO_DECKS_ARG
          The user argument that signifies a two-deck shoe
protected static java.lang.String USAGE
          The usage help text
 
Constructor Summary
(package private) BasicStrategyServerUtil()
           
 
Method Summary
(package private) static void ()
          Populates the soft score map and the hard score map using the sets of card values, soft, and hard scores.
protected static int getHardCardScore(java.lang.String card)
          Returns the hard card score for the specified card value.
protected static int getSoftCardScore(java.lang.String card)
          Returns the soft card score for the specified card value.
protected static boolean isValidCards(java.lang.String cards)
          Indicates whether the specified argument contains valid card values.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

CARDS

private static final java.lang.String[] CARDS
The set of card values

SOFT_CARD_SCORES

private static final int[] SOFT_CARD_SCORES
The set of soft card scores

HARD_CARD_SCORES

private static final int[] HARD_CARD_SCORES
The set of hard card scores

softCardScores

private static java.util.Map softCardScores
A collection mapping card values to soft card scores

hardCardScores

private static java.util.Map hardCardScores
A collection mapping card values to hard card scores

MAXIMUM_SCORE

protected static final int MAXIMUM_SCORE
The maximum score for a hand

MAXIMUM_HARD_CARD_SCORE

protected static final int MAXIMUM_HARD_CARD_SCORE
The maximum hard score for a single card

SOFT_SEVENTEEN_ARG

protected static final java.lang.String SOFT_SEVENTEEN_ARG
The user argument that signifies dealer hitting on soft seventeen

NO_DAS_ARG

protected static final java.lang.String NO_DAS_ARG
The user argument that signifies no doubling after a split

EARLY_SURRENDER_ARG

protected static final java.lang.String EARLY_SURRENDER_ARG
The user argument that signifies early surrender availability

SIX_DECKS_ARG

protected static final java.lang.String SIX_DECKS_ARG
The user argument that signifies a six-deck shoe

TWO_DECKS_ARG

protected static final java.lang.String TWO_DECKS_ARG
The user argument that signifies a two-deck shoe

ONE_DECK_ARG

protected static final java.lang.String ONE_DECK_ARG
The user argument that signifies a one-deck shoe

USAGE

protected static final java.lang.String USAGE
The usage help text
Constructor Detail

BasicStrategyServerUtil

BasicStrategyServerUtil()
Method Detail

static void ()
Populates the soft score map and the hard score map using the sets of card values, soft, and hard scores.

isValidCards

protected static boolean isValidCards(java.lang.String cards)
Indicates whether the specified argument contains valid card values.
Parameters:
cards - the String argument to test
Returns:
true if all of the characters are valid card values

getSoftCardScore

protected static int getSoftCardScore(java.lang.String card)
Returns the soft card score for the specified card value.
Parameters:
card - the card value
Returns:
the soft score for that card

getHardCardScore

protected static int getHardCardScore(java.lang.String card)
Returns the hard card score for the specified card value.
Parameters:
card - the card value
Returns:
the hard score for that card

Blackjack

Copyright © 2002 amoebacode.com.