|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object blackjackanalyst.observer.AbstractPlayerObserver
public abstract class AbstractPlayerObserver
An abstract class that defines an empty body for each method of interface
PlayerObserver
. Concrete implementations that are only
interested in select methods of the interface can extend this class for
clarity and convenience.
Constructor Summary | |
---|---|
AbstractPlayerObserver()
|
Method Summary | |
---|---|
void |
playerBets(int bet_amount,
int bankroll)
This method is invoked when the player makes a bet. |
void |
playerBlackjack(PlayerHand player_hand,
int amount_won,
int new_bankroll)
This method is invoked when the observed player gets a blackjack. |
void |
playerBusts(PlayerHand player_hand,
int amount_lost,
int new_bankroll)
This method is invoked when the player busts. |
void |
playerDealt(PlayerHand player_hand)
This method is invoked when the player is dealt a new hand. |
void |
playerDoublesDown(Card dealt_card,
PlayerHand new_hand)
This method is invoked when the player doubles down and is drawn a final card. |
void |
playerDraws(Card dealt_card,
PlayerHand new_hand)
This method is invoked when the player hits and is drawn a new card. |
void |
playerInsures(int bet_amount,
int bankroll)
This method is invoked when the player makes his insurance bet. |
void |
playerJoins(Table t)
This method is invoked when the player joins a table. |
void |
playerLeaves(Table t)
This method is invoked when the player leaves the table it had previously joined. |
void |
playerLoses(PlayerHand player_hand,
int amount_lost,
int new_bankroll)
This method is invoked when the observed player loses. |
void |
playerLosesInsurance(int bet_amount,
int new_bankroll)
This method is invoked when the observed player loses his insurance bet. |
void |
playerPush(PlayerHand player_hand,
int held_bankroll)
This method is invoked when the observed player ties the dealer, or pushes. |
void |
playerSplits(PlayerHand player_hand)
This method is invoked when the player splits the hand. |
void |
playerStands(PlayerHand player_hand)
This method is invoked when the player stands. |
void |
playerWins(PlayerHand player_hand,
int amount_won,
int new_bankroll)
This method is invoked when the observed player wins, but does not get blackjack. |
void |
playerWinsInsurance(int bet_amount,
int new_bankroll)
This method is invoked when the observed player wins his insurance bet. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractPlayerObserver()
Method Detail |
---|
public void playerJoins(Table t)
PlayerObserver
playerJoins
in interface PlayerObserver
t
- the table the player has joinedpublic void playerLeaves(Table t)
PlayerObserver
playerLeaves
in interface PlayerObserver
t
- the table the player has leftpublic void playerBets(int bet_amount, int bankroll)
PlayerObserver
playerBets
in interface PlayerObserver
bet_amount
- the amount the player betbankroll
- the bankroll of the player, which includes the amount betpublic void playerInsures(int bet_amount, int bankroll)
PlayerObserver
playerInsures
in interface PlayerObserver
bet_amount
- the amount the player insuresbankroll
- the bankroll of the player, which includes the amount betpublic void playerDealt(PlayerHand player_hand)
PlayerObserver
playerDealt
in interface PlayerObserver
player_hand
- the hand dealt to the playerpublic void playerDraws(Card dealt_card, PlayerHand new_hand)
PlayerObserver
playerDraws
in interface PlayerObserver
dealt_card
- the new card the player drawsnew_hand
- the player hand including the drawn cardpublic void playerStands(PlayerHand player_hand)
PlayerObserver
playerStands
in interface PlayerObserver
player_hand
- the player hand stood withpublic void playerBusts(PlayerHand player_hand, int amount_lost, int new_bankroll)
PlayerObserver
playerBusts
in interface PlayerObserver
player_hand
- the player hand busted withamount_lost
- the amount the player lostnew_bankroll
- the new bankroll of the player, after subtracting the losspublic void playerSplits(PlayerHand player_hand)
PlayerObserver
playerSplits
in interface PlayerObserver
player_hand
- the player hand that was splitpublic void playerDoublesDown(Card dealt_card, PlayerHand new_hand)
PlayerObserver
playerDoublesDown
in interface PlayerObserver
dealt_card
- the final card the player drawsnew_hand
- the player hand including the drawn cardpublic void playerWins(PlayerHand player_hand, int amount_won, int new_bankroll)
PlayerObserver
playerWins
in interface PlayerObserver
player_hand
- the hand the player won onamount_won
- the amount the player wonnew_bankroll
- the new bankroll of the player, after adding the winningpublic void playerLoses(PlayerHand player_hand, int amount_lost, int new_bankroll)
PlayerObserver
playerLoses
in interface PlayerObserver
player_hand
- the hand the player lost onamount_lost
- the amount the player lostnew_bankroll
- the new bankroll of the player, after subtracting the losspublic void playerBlackjack(PlayerHand player_hand, int amount_won, int new_bankroll)
PlayerObserver
playerBlackjack
in interface PlayerObserver
player_hand
- the hand the player received blackjack onamount_won
- the amount the player won on blackjacknew_bankroll
- the new bankroll of the player, after adding the winningpublic void playerPush(PlayerHand player_hand, int held_bankroll)
PlayerObserver
playerPush
in interface PlayerObserver
player_hand
- the hand the player pushed onheld_bankroll
- the unchanged bankroll of the playerpublic void playerWinsInsurance(int bet_amount, int new_bankroll)
PlayerObserver
playerWinsInsurance
in interface PlayerObserver
bet_amount
- the amount the player wonnew_bankroll
- the new bankroll of the player, after adding the winningpublic void playerLosesInsurance(int bet_amount, int new_bankroll)
PlayerObserver
playerLosesInsurance
in interface PlayerObserver
bet_amount
- the amount the player lostnew_bankroll
- the new bankroll of the player, after subtracting the loss
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |