Blackjack

com.amoebacode.blackjack.core
Interface IGame

All Superinterfaces:
IGameObject
All Known Implementing Classes:
Game

public interface IGame
extends IGameObject

IGame defines the public API for managing the blackjack game, including access to the deck, round, house rules, basic strategy, and preferences.

Version:
0.9
Author:
Jason Gurney

Method Summary
 boolean canDeal()
          Indicates whether the next round can be dealt.
 boolean canLowerBet()
          Indicates whether the user can lower the initial bet.
 boolean canRaiseBet()
          Indicates whether the user can raise the initial bet.
 void checkAction(IPlayerHand playerHand, java.lang.String action, int dealerScore)
          Checks whether the specified user action is the proper basic strategy play based on the specified dealer score.
 void deal()
          Clears the current round and starts the next one (called when the deal button is clicked).
 void executeCommand(ICommand command)
          Executes the specified game command, updates the available commands, finishes the round (when necessary).
 void finishRound()
          Displays the game buttons, updates the current balance, and lowers the initial bet (if necessary).
 double getCurrentBalance()
          Returns the user's current balance.
 IDeck getDeck()
          Returns the set of cards to be dealt.
 IHouseRules getHouseRules()
          Returns the casino options manager.
 int getInitialBet()
          Returns the user's initial bet for the current round.
 IRound getRound()
          Returns the current round of play.
 void lowerBet()
          Lowers the initial bet by the default bet interval.
 void raiseBet()
          Raises the initial bet by the default bet interval.
 void saveOptions()
          Saves the user-selected casino options.
 void shuffleDeck()
          Shuffles the deck of cards to be dealt.
 void startGame()
          Sets up the game, including the current round, the casino options, the user preferences, basic strategy, and the shoe.
 
Methods inherited from interface com.amoebacode.blackjack.core.IGameObject
addEventListener, getGame, getParent
 

Method Detail

canDeal

public boolean canDeal()
Indicates whether the next round can be dealt.
Returns:
true if the user can deal

deal

public void deal()
Clears the current round and starts the next one (called when the deal button is clicked).

getCurrentBalance

public double getCurrentBalance()
Returns the user's current balance.
Returns:
the current balance

saveOptions

public void saveOptions()
Saves the user-selected casino options.

getInitialBet

public int getInitialBet()
Returns the user's initial bet for the current round.
Returns:
the initial bet

getDeck

public IDeck getDeck()
Returns the set of cards to be dealt.
Returns:
the IDeck of cards

getRound

public IRound getRound()
Returns the current round of play.
Returns:
the current IRound

getHouseRules

public IHouseRules getHouseRules()
Returns the casino options manager.
Returns:
the HouseRules object

canLowerBet

public boolean canLowerBet()
Indicates whether the user can lower the initial bet.
Returns:
true if the initial bet can be lowered

lowerBet

public void lowerBet()
Lowers the initial bet by the default bet interval.

canRaiseBet

public boolean canRaiseBet()
Indicates whether the user can raise the initial bet.
Returns:
true if the initial bet can be raised

raiseBet

public void raiseBet()
Raises the initial bet by the default bet interval.

executeCommand

public void executeCommand(ICommand command)
Executes the specified game command, updates the available commands, finishes the round (when necessary).
Parameters:
command -  

finishRound

public void finishRound()
Displays the game buttons, updates the current balance, and lowers the initial bet (if necessary).

shuffleDeck

public void shuffleDeck()
Shuffles the deck of cards to be dealt.

checkAction

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

startGame

public void startGame()
Sets up the game, including the current round, the casino options, the user preferences, basic strategy, and the shoe.

Blackjack

Copyright © 2002 amoebacode.com.