|
Blackjack | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--com.amoebacode.blackjack.core.GameObject
|
+--com.amoebacode.blackjack.core.Round
Round manages a round of blackjack, including the dealer hand and the player.
| Field Summary | |
private IDealer |
dealer
The dealer hand object |
private IPlayer |
player
The set of player hands |
| Fields inherited from class com.amoebacode.blackjack.core.GameObject |
listeners, parent |
| Constructor Summary | |
protected |
Round(IGame game)
Default protected constructor. |
| Method Summary | |
boolean |
allPlayerHandsBlackjack()
Indicates whether all of the player hands have blackjack. |
boolean |
allPlayerHandsBustedOrSurrendered()
Indicates whether all of the player hands have busted or surrendered. |
void |
checkAction(IPlayerHand playerHand,
java.lang.String action)
Checks whether the specified user action is the proper basic strategy play. |
void |
clear()
Clears each of the round participants. |
void |
completeDealer()
Completes the dealer (called when the player is finished). |
boolean |
dealerHasBlackjack()
Indicates whether the dealer has blackjack. |
boolean |
firstDealerCardIsAce()
Indicates whether insurance should be offered to the user. |
double |
getPlayerNetGain()
Returns the net gain for the player hands. |
private RoundEventListenerCollection |
getRoundEventListenerCollection()
Returns the event listener collection for this round. |
boolean |
playerFinished()
Indicates whether the player has finished all player hands. |
void |
setupParticipants()
Sets up the dealer and player participants and notifies the GUI listeners. |
void |
startRound(int initialBet)
Starts the round with the specified initial bet. |
void |
updateAvailableCommands()
Updates the set of available player hand commands for each GUI listener. |
| Methods inherited from class com.amoebacode.blackjack.core.GameObject |
addEventListener, getEventListenerCollection, getGame, getParent, hasParent, setEventListenerCollection |
| Methods inherited from class java.lang.Object |
|
| Methods inherited from interface com.amoebacode.blackjack.core.IGameObject |
addEventListener, getGame, getParent |
| Field Detail |
private IDealer dealer
private IPlayer player
| Constructor Detail |
protected Round(IGame game)
game - main IGame object| Method Detail |
public void setupParticipants()
IRoundsetupParticipants in interface IRoundIRound.setupParticipants()public void startRound(int initialBet)
IRoundstartRound in interface IRoundIRound.startRound(int)public boolean dealerHasBlackjack()
IRounddealerHasBlackjack in interface IRoundIRound.dealerHasBlackjack()public boolean allPlayerHandsBustedOrSurrendered()
IRoundallPlayerHandsBustedOrSurrendered in interface IRoundIRound.allPlayerHandsBustedOrSurrendered()public boolean allPlayerHandsBlackjack()
IRoundallPlayerHandsBlackjack in interface IRoundIRound.allPlayerHandsBlackjack()public boolean playerFinished()
IRoundplayerFinished in interface IRoundIRound.playerFinished()public void completeDealer()
IRoundcompleteDealer in interface IRoundIRound.completeDealer()public void clear()
IRoundclear in interface IRoundIRound.clear()public boolean firstDealerCardIsAce()
IRoundfirstDealerCardIsAce in interface IRoundIRound.firstDealerCardIsAce()
public void checkAction(IPlayerHand playerHand,
java.lang.String action)
IRoundcheckAction in interface IRoundIRound.checkAction(IPlayerHand, String)public void updateAvailableCommands()
IRoundupdateAvailableCommands in interface IRoundIRound.updateAvailableCommands()private RoundEventListenerCollection getRoundEventListenerCollection()
public double getPlayerNetGain()
IRoundgetPlayerNetGain in interface IRoundIRound.getPlayerNetGain()
|
Blackjack | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||