Blackjack

com.amoebacode.blackjack.core
Interface IRound

All Superinterfaces:
IGameObject
All Known Implementing Classes:
Round

public interface IRound
extends IGameObject

IRound defines the public API for managing a round of blackjack, including access to the dealer hand and the player.

Version:
0.9
Author:
Jason Gurney

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.
 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 interface com.amoebacode.blackjack.core.IGameObject
addEventListener, getGame, getParent
 

Method Detail

allPlayerHandsBustedOrSurrendered

public boolean allPlayerHandsBustedOrSurrendered()
Indicates whether all of the player hands have busted or surrendered. (This means that the dealer does not need to take any cards.)
Returns:
true if all of the player hands have busted or surrendered

allPlayerHandsBlackjack

public boolean allPlayerHandsBlackjack()
Indicates whether all of the player hands have blackjack. (This means that the dealer does not need to take any cards.)
Returns:
true if all of the player hands have blackjack

clear

public void clear()
Clears each of the round participants.

startRound

public void startRound(int initialBet)
Starts the round with the specified initial bet.
Parameters:
initialBet - the initial player bet

playerFinished

public boolean playerFinished()
Indicates whether the player has finished all player hands.
Returns:
true if the player has finished this round

completeDealer

public void completeDealer()
Completes the dealer (called when the player is finished).

dealerHasBlackjack

public boolean dealerHasBlackjack()
Indicates whether the dealer has blackjack.
Returns:
true if the dealer has blackjack

firstDealerCardIsAce

public boolean firstDealerCardIsAce()
Indicates whether insurance should be offered to the user.
Returns:
true if the dealer's first card is an ace

updateAvailableCommands

public void updateAvailableCommands()
Updates the set of available player hand commands for each GUI listener.

checkAction

public void checkAction(IPlayerHand playerHand,
                        java.lang.String action)
Checks whether the specified user action is the proper basic strategy play.
Parameters:
playerHand - the IPlayerHand making the action
action - a String representing the decision chosen

setupParticipants

public void setupParticipants()
Sets up the dealer and player participants and notifies the GUI listeners.

getPlayerNetGain

public double getPlayerNetGain()
Returns the net gain for the player hands.
Returns:
the player's net gain

Blackjack

Copyright © 2002 amoebacode.com.