|
Blackjack | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--com.amoebacode.blackjack.display.DisplayElement
|
+--com.amoebacode.blackjack.display.GameDisplay
GameDisplay manages the display of all game elements, including the round, deck preferences, basic strategy tutor, and house rules.
| Field Summary | |
private ActionQueue |
actionQueue
The list of display actions to perform |
private LabelWrapper |
balanceLabel
The current balance text label |
private LabelWrapper |
betLabel
The current bet text label |
private DeckDisplay |
deckDisplay
The display for the set of cards to be dealt |
private DisplayManager |
display
The current display manager |
private DisplayPreferences |
displayPrefs
The display preferences |
private IGame |
game
The game being displayed |
private GameButtonSet |
gameButtonSet
The set of game buttons (deal, shuffle, raise bet, etc.) |
private HouseRulesDisplay |
houseRulesDisplay
The display for the set of casino options |
private PreferencesDisplay |
prefsDisplay
The display for the set of game preferences |
private RoundDisplay |
roundDisplay
The display for current round of play |
private BasicStrategyDisplay |
stratDisplay
The basic strategy tutor |
| Fields inherited from class com.amoebacode.blackjack.display.DisplayElement |
parent |
| Constructor Summary | |
GameDisplay(DisplayManager display)
Default public constructor. |
|
| Method Summary | |
void |
deal()
Executes a deal command. |
protected void |
executeCommand(ICommand command)
Sends the specified command to the game object for execution. |
DisplayManager |
getDisplayManager()
Returns the display manager from the game display. |
protected DisplayPreferences |
getDisplayPreferences()
Returns the current set of display preferences. |
void |
hideBasicStrategy()
Hides the basic strategy labels. |
void |
hideButtons()
Hides the game buttons. |
void |
hideOptions()
Hides the casino options and displays the game buttons. |
void |
hidePreferences()
Hides the preferences options and displays the game buttons. |
void |
lowerBet()
Executes a lower bet command. |
void |
performUpdateBalanceLabelAction()
Updates the current balance label and resumes the action queue. |
void |
performUpdateCommandsAction(AvailableGameCommands availableCommands)
Updates the game buttons with the specified set of available commands and resumes the action queue. |
protected void |
playClip(java.lang.String audioClip)
Plays the specified audio clip. |
protected void |
queueAction(QueueableAction action)
Sends the specified action to the action queue. |
void |
raiseBet()
Executes a raise bet command. |
protected void |
resumeQueue()
Resumes the game display queue. |
void |
saveOptions()
Saves and hides the user-selected casino options. |
void |
setBasicStrategy(BlackjackEvent event)
Sets the basic strategy tutor in this game display object. |
void |
setDeck(BlackjackEvent event)
Sets the deck in this game display object. |
void |
setGame(IGame game)
Sets the game to display |
void |
setHouseRules(BlackjackEvent event)
Sets the casino options in this game display object. |
void |
setPreferences(BlackjackEvent event)
Sets the user preferences in this game display object. |
void |
setRound(BlackjackEvent event)
Sets the round in this game display object. |
private void |
setupDisplayElements()
Sets up the various display elements, including the current round, the shoe of cards, the user preferences, the basic strategy tutor, the casino options, and the game buttons. |
void |
showOptions()
Displays the casino options and hides the game buttons. |
void |
showPreferences()
Displays the preferences options and hides the game buttons. |
void |
shuffle()
Executes a shuffle command. |
void |
updateAvailableCommands(BlackjackEvent event)
Updates the set of commands available to this game display object. |
void |
updateBalanceLabel(BlackjackEvent event)
Updates the current balance label in this game display object. |
void |
updateBetLabel(BlackjackEvent event)
Updates the initial bet label in this game display object. |
| Methods inherited from class com.amoebacode.blackjack.display.DisplayElement |
executeGameCommand, getGameDisplay, getParent, hasParent, playGameClip |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
private DisplayManager display
private IGame game
private RoundDisplay roundDisplay
private DeckDisplay deckDisplay
private PreferencesDisplay prefsDisplay
private DisplayPreferences displayPrefs
private HouseRulesDisplay houseRulesDisplay
private BasicStrategyDisplay stratDisplay
private ActionQueue actionQueue
private LabelWrapper balanceLabel
private LabelWrapper betLabel
private GameButtonSet gameButtonSet
| Constructor Detail |
public GameDisplay(DisplayManager display)
display - the current DisplayManager| Method Detail |
private void setupDisplayElements()
public DisplayManager getDisplayManager()
DisplayElementgetDisplayManager in class DisplayElementDisplayElement.getDisplayManager()public void setGame(IGame game)
game - the IGame to displaypublic void setDeck(BlackjackEvent event)
GameEventListenersetDeck in interface GameEventListenerGameEventListener.setDeck(BlackjackEvent)public void setPreferences(BlackjackEvent event)
GameEventListenersetPreferences in interface GameEventListenerGameEventListener.setPreferences(BlackjackEvent)public void setHouseRules(BlackjackEvent event)
GameEventListenersetHouseRules in interface GameEventListenerGameEventListener.setHouseRules(BlackjackEvent)public void setBasicStrategy(BlackjackEvent event)
GameEventListenersetBasicStrategy in interface GameEventListenerGameEventListener.setBasicStrategy(BlackjackEvent)protected DisplayPreferences getDisplayPreferences()
public void hidePreferences()
public void showPreferences()
public void hideBasicStrategy()
public void deal()
public void lowerBet()
public void raiseBet()
public void saveOptions()
public void shuffle()
public void updateAvailableCommands(BlackjackEvent event)
GameEventListenerupdateAvailableCommands in interface GameEventListenerGameEventListener.updateAvailableCommands(BlackjackEvent)public void performUpdateCommandsAction(AvailableGameCommands availableCommands)
availableCommands - the available game commandspublic void hideOptions()
public void showOptions()
public void updateBetLabel(BlackjackEvent event)
GameEventListenerupdateBetLabel in interface GameEventListenerGameEventListener.updateBetLabel(BlackjackEvent)public void updateBalanceLabel(BlackjackEvent event)
GameEventListenerupdateBalanceLabel in interface GameEventListenerGameEventListener.updateBalanceLabel(BlackjackEvent)public void performUpdateBalanceLabelAction()
protected void executeCommand(ICommand command)
command - the ICommand to executeprotected void queueAction(QueueableAction action)
queueAction in class DisplayElementaction - the QueueableAction to performprotected void resumeQueue()
DisplayElementresumeQueue in class DisplayElementDisplayElement.resumeQueue()protected void playClip(java.lang.String audioClip)
audioClip - the name of the clip to playpublic void hideButtons()
public void setRound(BlackjackEvent event)
GameEventListenersetRound in interface GameEventListenerGameEventListener.setRound(BlackjackEvent)
|
Blackjack | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||