Blackjack

com.amoebacode.blackjack.display
Class HouseRulesDisplay

java.lang.Object
  |
  +--com.amoebacode.blackjack.display.DisplayElement
        |
        +--com.amoebacode.blackjack.display.HouseRulesDisplay

public class HouseRulesDisplay
extends DisplayElement

HouseRulesDisplay handles display of the casino options.

Version:
0.9
Author:
Jason Gurney

Field Summary
private  HouseRulesComboBox dasComboBox
          The double after split availability selection box
private  HouseRulesComboBox decksComboBox
          The number of decks selection box
private  HouseRulesComboBox doubleAnyComboBox
          The double down availability selection box
private  IHouseRules houseRules
          The casino options being displayed
private  int previousNumberOfDecks
          The previous number of decks included in the shoe
private  HouseRulesComboBox soft17ComboBox
          The dealer hits soft seventeen selection box
private  HouseRulesComboBox surrenderComboBox
          The surrender availability selection box
 
Fields inherited from class com.amoebacode.blackjack.display.DisplayElement
parent
 
Constructor Summary
protected HouseRulesDisplay(GameDisplay parent)
          Default protected 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 getNumberOfDecks()
          Returns the number of decks in the dealer's shoe.
protected  void hideOptions()
          Hides the casino option select boxes.
 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 canDouble)
          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 setHouseRules(IHouseRules houseRules)
          Sets the casino options being displayed.
 void setNumberOfDecks(int numberOfDecks)
          Sets the number of decks in the dealer's shoe.
private  void setupOptions()
          Creates and hides the casino option select boxes.
 void showOptions()
          Unhides the casino option select boxes.
private  void showOptions(boolean display)
          Displays or hides the casino option select boxes.
 
Methods inherited from class com.amoebacode.blackjack.display.DisplayElement
executeGameCommand, getDisplayManager, getGameDisplay, getParent, hasParent, playGameClip, queueAction, resumeQueue
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

decksComboBox

private HouseRulesComboBox decksComboBox
The number of decks selection box

soft17ComboBox

private HouseRulesComboBox soft17ComboBox
The dealer hits soft seventeen selection box

surrenderComboBox

private HouseRulesComboBox surrenderComboBox
The surrender availability selection box

dasComboBox

private HouseRulesComboBox dasComboBox
The double after split availability selection box

doubleAnyComboBox

private HouseRulesComboBox doubleAnyComboBox
The double down availability selection box

houseRules

private IHouseRules houseRules
The casino options being displayed

previousNumberOfDecks

private int previousNumberOfDecks
The previous number of decks included in the shoe
Constructor Detail

HouseRulesDisplay

protected HouseRulesDisplay(GameDisplay parent)
Default protected constructor.
Parameters:
parent - the GameDisplay parent
Method Detail

setupOptions

private void setupOptions()
Creates and hides the casino option select boxes.

showOptions

public void showOptions()
Unhides the casino option select boxes.

showOptions

private void showOptions(boolean display)
Displays or hides the casino option select boxes.
Parameters:
display - the new visibility attribute

hideOptions

protected void hideOptions()
Hides the casino option select boxes.

setHouseRules

public void setHouseRules(IHouseRules houseRules)
Sets the casino options being displayed.
Parameters:
houseRules - the casino options

canDoubleAfterSplit

public boolean canDoubleAfterSplit()
Indicates whether the player can double down after splitting.
Returns:
true if the player can double after split

setCanDoubleAfterSplit

public void setCanDoubleAfterSplit(boolean canDouble)
Sets the double after split option.
Parameters:
canDoubleAfterSplit - the new double after split policy

getNumberOfDecks

public int getNumberOfDecks()
Returns the number of decks in the dealer's shoe.
Returns:
int the number of decks

setNumberOfDecks

public void setNumberOfDecks(int numberOfDecks)
Sets the number of decks in the dealer's shoe.
Parameters:
numberOfDecks - the new number of decks

setCanDouble

public void setCanDouble(java.lang.String canDouble)
Sets the double down availability option.
Parameters:
canDouble - the new double down availability

canDoubleAnyTwoCards

public boolean canDoubleAnyTwoCards()
Indicates whether the user can double any two cards.
Returns:
true if the user can double any two cards

canDoubleNineTenElevenOnly

public boolean canDoubleNineTenElevenOnly()
Indicates whether the user can double a nine, ten, or eleven only.
Returns:
true if the user can double 9, 10, or 11 only

canDoubleTenElevenOnly

public boolean canDoubleTenElevenOnly()
Indicates whether the user can double a ten or eleven only.
Returns:
true if the user can double 10, or 11 only

dealerHitsSoftSeventeen

public boolean dealerHitsSoftSeventeen()
Indicates whether the dealer hits a soft seventeen.
Returns:
true if the dealer hits a soft seventeen

setDealerHitsSoftSeventeen

public void setDealerHitsSoftSeventeen(boolean dealerHitsSoftSeventeen)
Sets the soft seventeen dealer option.
Parameters:
dealerHitsSoftSeventeen - the new soft seventeen dealer policy

lateSurrenderOnlyAvailable

public boolean lateSurrenderOnlyAvailable()
Indicates whether late surrender is available.
Returns:
true if late surrender is available

noSurrenderAvailable

public boolean noSurrenderAvailable()
Indicates whether no surrender is available.
Returns:
true if no surrender is available

earlySurrenderAvailable

public boolean earlySurrenderAvailable()
Indicates whether early surrender is available.
Returns:
true if early surrender is available

setCanSurrender

public void setCanSurrender(java.lang.String canSurrender)
Sets the surrender availability option.
Parameters:
canSurrender - the new surrender availability

Blackjack

Copyright © 2002 amoebacode.com.