Blackjack

com.amoebacode.blackjack.core
Class HouseRules

java.lang.Object
  |
  +--com.amoebacode.blackjack.core.HouseRules
All Implemented Interfaces:
IHouseRules

public class HouseRules
extends java.lang.Object
implements IHouseRules

HouseRules manages displaying and updating user-configurable casino options.

Version:
0.9
Author:
Jason Gurney

Field Summary
private  java.lang.String canDouble
          The selected double down availability
private  boolean canDoubleAfterSplit
          Indicates whether the player can double down after splitting
private  java.lang.String canSurrender
          The selected surrender availability
private  boolean dealerHitsSoftSeventeen
          Indicates whether the dealer hits a soft seventeen
private static int MAX_HARD_DEALER_HIT
          The highest hard score that a dealer would hit
private  int numberOfDecks
          The number of decks in the dealer's shoe
 
Fields inherited from interface com.amoebacode.blackjack.core.IHouseRules
ANY_TWO_CARDS, EARLY_SURRENDER, LATE_SURRENDER, NINE_TEN_ELEVEN, NO_SURRENDER, TEN_ELEVEN
 
Constructor Summary
HouseRules()
          Default public constructor.
 
Method Summary
 boolean canDoubleAfterSplit()
          Indicates whether the player can double down after splitting.
 boolean canDoubleAnyTwoCards()
          Indicates whether the user can double any two cards.
 boolean canDoubleNineTenElevenOnly()
          Indicates whether the user can double a nine, ten, or eleven only.
 boolean canDoubleTenElevenOnly()
          Indicates whether the user can double a ten or eleven only.
 boolean dealerHitsSoftSeventeen()
          Indicates whether the dealer hits a soft seventeen.
 boolean earlySurrenderAvailable()
          Indicates whether early surrender is available.
 int getMaxHardDealerHit()
          Returns the highest hard score that a dealer would hit.
 int getMaxSoftDealerHit()
          Returns the highest soft score that a dealer would hit.
 int getNumberOfDecks()
          Returns the number of decks in the dealer's shoe.
 boolean lateSurrenderOnlyAvailable()
          Indicates whether late surrender is available.
 boolean noSurrenderAvailable()
          Indicates whether no surrender is available.
 void setCanDouble(java.lang.String canDouble)
          Sets the double down availability option.
 void setCanDoubleAfterSplit(boolean canDoubleAfterSplit)
          Sets the double after split option.
 void setCanSurrender(java.lang.String canSurrender)
          Sets the surrender availability option.
 void setDealerHitsSoftSeventeen(boolean dealerHitsSoftSeventeen)
          Sets the soft seventeen dealer option.
 void setEarlySurrenderAvailable()
          Sets the surrender availability to early.
 void setNumberOfDecks(int numberOfDecks)
          Sets the number of decks in the dealer's shoe.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

MAX_HARD_DEALER_HIT

private static final int MAX_HARD_DEALER_HIT
The highest hard score that a dealer would hit

canDouble

private java.lang.String canDouble
The selected double down availability

canSurrender

private java.lang.String canSurrender
The selected surrender availability

numberOfDecks

private int numberOfDecks
The number of decks in the dealer's shoe

dealerHitsSoftSeventeen

private boolean dealerHitsSoftSeventeen
Indicates whether the dealer hits a soft seventeen

canDoubleAfterSplit

private boolean canDoubleAfterSplit
Indicates whether the player can double down after splitting
Constructor Detail

HouseRules

public HouseRules()
Default public constructor.
Method Detail

setCanDouble

public void setCanDouble(java.lang.String canDouble)
Description copied from interface: IHouseRules
Sets the double down availability option.
Specified by:
setCanDouble in interface IHouseRules
See Also:
IHouseRules.setCanDouble(String)

setCanSurrender

public void setCanSurrender(java.lang.String canSurrender)
Description copied from interface: IHouseRules
Sets the surrender availability option.
Specified by:
setCanSurrender in interface IHouseRules
See Also:
IHouseRules.setCanSurrender(String)

canDoubleAnyTwoCards

public boolean canDoubleAnyTwoCards()
Description copied from interface: IHouseRules
Indicates whether the user can double any two cards.
Specified by:
canDoubleAnyTwoCards in interface IHouseRules
See Also:
IHouseRules.canDoubleAnyTwoCards()

canDoubleNineTenElevenOnly

public boolean canDoubleNineTenElevenOnly()
Description copied from interface: IHouseRules
Indicates whether the user can double a nine, ten, or eleven only.
Specified by:
canDoubleNineTenElevenOnly in interface IHouseRules
See Also:
IHouseRules.canDoubleNineTenElevenOnly()

canDoubleTenElevenOnly

public boolean canDoubleTenElevenOnly()
Description copied from interface: IHouseRules
Indicates whether the user can double a ten or eleven only.
Specified by:
canDoubleTenElevenOnly in interface IHouseRules
See Also:
IHouseRules.canDoubleTenElevenOnly()

earlySurrenderAvailable

public boolean earlySurrenderAvailable()
Description copied from interface: IHouseRules
Indicates whether early surrender is available.
Specified by:
earlySurrenderAvailable in interface IHouseRules
See Also:
IHouseRules.earlySurrenderAvailable()

setEarlySurrenderAvailable

public void setEarlySurrenderAvailable()
Description copied from interface: IHouseRules
Sets the surrender availability to early.
Specified by:
setEarlySurrenderAvailable in interface IHouseRules
See Also:
IHouseRules.setEarlySurrenderAvailable()

lateSurrenderOnlyAvailable

public boolean lateSurrenderOnlyAvailable()
Description copied from interface: IHouseRules
Indicates whether late surrender is available.
Specified by:
lateSurrenderOnlyAvailable in interface IHouseRules
See Also:
IHouseRules.lateSurrenderOnlyAvailable()

noSurrenderAvailable

public boolean noSurrenderAvailable()
Description copied from interface: IHouseRules
Indicates whether no surrender is available.
Specified by:
noSurrenderAvailable in interface IHouseRules
See Also:
IHouseRules.noSurrenderAvailable()

dealerHitsSoftSeventeen

public boolean dealerHitsSoftSeventeen()
Description copied from interface: IHouseRules
Indicates whether the dealer hits a soft seventeen.
Specified by:
dealerHitsSoftSeventeen in interface IHouseRules
See Also:
IHouseRules.dealerHitsSoftSeventeen()

setDealerHitsSoftSeventeen

public void setDealerHitsSoftSeventeen(boolean dealerHitsSoftSeventeen)
Description copied from interface: IHouseRules
Sets the soft seventeen dealer option.
Specified by:
setDealerHitsSoftSeventeen in interface IHouseRules
See Also:
IHouseRules.setDealerHitsSoftSeventeen(boolean)

canDoubleAfterSplit

public boolean canDoubleAfterSplit()
Description copied from interface: IHouseRules
Indicates whether the player can double down after splitting.
Specified by:
canDoubleAfterSplit in interface IHouseRules
See Also:
IHouseRules.canDoubleAfterSplit()

setCanDoubleAfterSplit

public void setCanDoubleAfterSplit(boolean canDoubleAfterSplit)
Description copied from interface: IHouseRules
Sets the double after split option.
Specified by:
setCanDoubleAfterSplit in interface IHouseRules
See Also:
IHouseRules.setCanDoubleAfterSplit(boolean)

getNumberOfDecks

public int getNumberOfDecks()
Description copied from interface: IHouseRules
Returns the number of decks in the dealer's shoe.
Specified by:
getNumberOfDecks in interface IHouseRules
See Also:
IHouseRules.getNumberOfDecks()

setNumberOfDecks

public void setNumberOfDecks(int numberOfDecks)
Description copied from interface: IHouseRules
Sets the number of decks in the dealer's shoe.
Specified by:
setNumberOfDecks in interface IHouseRules
See Also:
IHouseRules.setNumberOfDecks(int)

getMaxHardDealerHit

public int getMaxHardDealerHit()
Description copied from interface: IHouseRules
Returns the highest hard score that a dealer would hit.
Specified by:
getMaxHardDealerHit in interface IHouseRules
See Also:
IHouseRules.getMaxHardDealerHit()

getMaxSoftDealerHit

public int getMaxSoftDealerHit()
Description copied from interface: IHouseRules
Returns the highest soft score that a dealer would hit.
Specified by:
getMaxSoftDealerHit in interface IHouseRules
See Also:
IHouseRules.getMaxSoftDealerHit()

Blackjack

Copyright © 2002 amoebacode.com.