|
-footer | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface EventHandler
Provides a callback interface for playing blackjack. The user implements this interface
with logic that controls how the game should be played, then invokes
Blackjack.playGame(EventHandler, double) to play a game.
See TextPlayer for an example implementation.
| Method Summary | |
|---|---|
void |
fatalErrorOccurred(java.lang.Exception e)
This method is invoked when an error occurs that prevents the game from completing. |
void |
handFinished(Hand hand,
double gain,
Result result,
CardList dealerCards)
Method that is invoked when a hand is done being played. |
boolean |
offerEarlySurrender(Hand hand)
Method that is optionally invoked if the player has the option of early surrender. |
Move |
offerRegularTurn(Hand hand)
Method invoked when the player is offered a turn. |
| Method Detail |
|---|
void fatalErrorOccurred(java.lang.Exception e)
e - the exception that caused the error
void handFinished(Hand hand,
double gain,
Result result,
CardList dealerCards)
hand - the hand which has completed the gamegain - the winnings from the hand; negative if the wager was lostresult - the result of the hand; see ResultdealerCards - the cards that the dealer ended the hand withboolean offerEarlySurrender(Hand hand)
hand - the hand for which early surrender is being offered
true if the user wishes to surrender;
false otherwiseMove offerRegularTurn(Hand hand)
Move they wish to make.
hand - the hand for which a turn is being offered
Move the player whishes to make
|
-footer | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||