|
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.HandDisplay
|
+--com.amoebacode.blackjack.display.PlayerHandDisplay
PlayerHandDisplay handles the GUI display of a player hand
| Field Summary | |
private LabelWrapper |
betLabel
The bet label for this hand |
private HandButtonSet |
handButtonSet
The set of hand buttons (hit, stand, double down, etc.) |
private boolean |
isShowingNetGain
Indicates whether the net gain is currently being displayed |
| Fields inherited from class com.amoebacode.blackjack.display.HandDisplay |
cardDisplays, currentScore, hand, isAnimating, xPos, yPos |
| Fields inherited from class com.amoebacode.blackjack.display.DisplayElement |
parent |
| Constructor Summary | |
protected |
PlayerHandDisplay(PlayerDisplay player)
Default protected constructor. |
| Method Summary | |
void |
buyInsurance()
Executes a buy insurance command. |
void |
checkAction(java.lang.String action)
Checks whether the specified user action is the proper basic strategy play. |
void |
clear(BlackjackEvent event)
Clears this hand display object. |
void |
declineInsurance()
Executes a decline insurance command. |
void |
disableButtons()
Disables the buttons corresponding to this hand. |
void |
doubleDown()
Executes a double down command. |
void |
drawNetGain(BlackjackEvent event)
Draws the net gain for this player hand display object. |
private void |
drawNetGain(int netGain)
Draws the specified net gain on the bet label. |
int |
getBetXPos()
Returns the horizontal location of the bet label. |
int |
getBetYPos()
Returns the vertical location of the bet label. |
protected Coordinate |
getCoordinates()
Returns the horizontal and vertical position of this hand. |
int |
getCurrentScoreYPos()
Returns the vertical position of the current score label. |
private IPlayerHand |
getPlayerHand()
Returns the player hand being displayed. |
int |
getXButtonPos()
Returns the horizontal location of the hand buttons. |
int |
getYButtonPos()
Returns the vertical location of the hand buttons. |
void |
hit()
Executes a hit command. |
void |
performDrawNetGainAction(int netGain)
Draws the specified net gain for this player hand display object and resumes the action queue. |
void |
performUpdateCommandsAction(AvailableHandCommands availableCommands)
Updates the availability of the hand buttons and resumes the action queue. |
protected void |
setupDisplay()
Draws the buttons, cards, and bet label. |
void |
split()
Executes a split command. |
void |
stand()
Executes a stand command. |
void |
startAnimatedCard()
Sets up the animation for the most recently added card. |
void |
stopAnimatedCard()
Turns off the card animation. |
void |
surrender()
Executes a surrender command. |
void |
updateAvailableCommands(BlackjackEvent event)
Updates the set of commands available to this player hand display object. |
void |
updateBetLabel(BlackjackEvent event)
Updates the bet label for this player hand display object. |
| Methods inherited from class com.amoebacode.blackjack.display.HandDisplay |
addCard, clearCards, clearCurrentScore, drawCard, drawCard, drawCards, getCardDisplay, getCardDisplayAt, getCurrentScoreXPos, getHand, getNumberOfCardDisplays, performAddCardAction, removeCard, resume, setCoordinates, setHand |
| Methods inherited from class com.amoebacode.blackjack.display.DisplayElement |
executeGameCommand, getDisplayManager, getGameDisplay, getParent, hasParent, playGameClip, queueAction, resumeQueue |
| Methods inherited from class java.lang.Object |
|
| Methods inherited from interface com.amoebacode.blackjack.event.HandEventListener |
addCard, removeCard |
| Field Detail |
private boolean isShowingNetGain
private LabelWrapper betLabel
private HandButtonSet handButtonSet
| Constructor Detail |
protected PlayerHandDisplay(PlayerDisplay player)
player - the PlayerDisplay parent| Method Detail |
protected void setupDisplay()
setupDisplay in class HandDisplayprotected Coordinate getCoordinates()
HandDisplaygetCoordinates in class HandDisplayHandDisplay.getCoordinates()public int getCurrentScoreYPos()
HandDisplaygetCurrentScoreYPos in class HandDisplayHandDisplay.getCurrentScoreYPos()public int getBetXPos()
public int getBetYPos()
public int getXButtonPos()
public int getYButtonPos()
private void drawNetGain(int netGain)
netGain - the net gain for this handpublic void clear(BlackjackEvent event)
HandEventListenerclear in interface HandEventListenerclear in class HandDisplayHandEventListener.clear(BlackjackEvent)public void disableButtons()
private IPlayerHand getPlayerHand()
public void doubleDown()
public void hit()
public void buyInsurance()
public void declineInsurance()
public void split()
public void stand()
public void surrender()
public void checkAction(java.lang.String action)
action - a String representing the decision chosenpublic void startAnimatedCard()
HandDisplaystartAnimatedCard in class HandDisplayHandDisplay.startAnimatedCard()public void stopAnimatedCard()
HandDisplaystopAnimatedCard in class HandDisplayHandDisplay.stopAnimatedCard()public void updateBetLabel(BlackjackEvent event)
PlayerHandEventListenerupdateBetLabel in interface PlayerHandEventListenerPlayerHandEventListener.updateBetLabel(BlackjackEvent)public void drawNetGain(BlackjackEvent event)
PlayerHandEventListenerdrawNetGain in interface PlayerHandEventListenerPlayerHandEventListener.drawNetGain(BlackjackEvent)public void performDrawNetGainAction(int netGain)
netGain - the amount to displaypublic void updateAvailableCommands(BlackjackEvent event)
PlayerHandEventListenerupdateAvailableCommands in interface PlayerHandEventListenerPlayerHandEventListener.updateAvailableCommands(BlackjackEvent)public void performUpdateCommandsAction(AvailableHandCommands availableCommands)
availableCommands - the available set of hand commands
|
Blackjack | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||