|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectblackjackanalyst.observer.ConsolePlayerObserver
public class ConsolePlayerObserver
An implementation of interface PlayerObserver that writes to
the console.
| Constructor Summary | |
|---|---|
ConsolePlayerObserver(Player _p)
Creates a new player observer that writes to the console. |
|
| Method Summary | |
|---|---|
Player |
getPlayer()
Returns the player this object observes. |
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 amount_lost,
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 amount_won,
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 ConsolePlayerObserver(Player _p)
_p - the player to observe| Method Detail |
|---|
public Player getPlayer()
public void playerJoins(Table t)
PlayerObserver
playerJoins in interface PlayerObservert - the table the player has joinedpublic void playerLeaves(Table t)
PlayerObserver
playerLeaves in interface PlayerObservert - the table the player has left
public void playerBets(int bet_amount,
int bankroll)
PlayerObserver
playerBets in interface PlayerObserverbet_amount - the amount the player betbankroll - the bankroll of the player, which includes the amount bet
public void playerInsures(int bet_amount,
int bankroll)
PlayerObserver
playerInsures in interface PlayerObserverbet_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 PlayerObserverplayer_hand - the hand dealt to the player
public void playerDraws(Card dealt_card,
PlayerHand new_hand)
PlayerObserver
playerDraws in interface PlayerObserverdealt_card - the new card the player drawsnew_hand - the player hand including the drawn cardpublic void playerStands(PlayerHand player_hand)
PlayerObserver
playerStands in interface PlayerObserverplayer_hand - the player hand stood with
public void playerBusts(PlayerHand player_hand,
int amount_lost,
int new_bankroll)
PlayerObserver
playerBusts in interface PlayerObserverplayer_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 PlayerObserverplayer_hand - the player hand that was split
public void playerDoublesDown(Card dealt_card,
PlayerHand new_hand)
PlayerObserver
playerDoublesDown in interface PlayerObserverdealt_card - the final card the player drawsnew_hand - the player hand including the drawn card
public void playerWins(PlayerHand player_hand,
int amount_won,
int new_bankroll)
PlayerObserver
playerWins in interface PlayerObserverplayer_hand - the hand the player won onamount_won - the amount the player wonnew_bankroll - the new bankroll of the player, after adding the winning
public void playerLoses(PlayerHand player_hand,
int amount_lost,
int new_bankroll)
PlayerObserver
playerLoses in interface PlayerObserverplayer_hand - the hand the player lost onamount_lost - the amount the player lostnew_bankroll - the new bankroll of the player, after subtracting the loss
public void playerBlackjack(PlayerHand player_hand,
int amount_won,
int new_bankroll)
PlayerObserver
playerBlackjack in interface PlayerObserverplayer_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 winning
public void playerPush(PlayerHand player_hand,
int held_bankroll)
PlayerObserver
playerPush in interface PlayerObserverplayer_hand - the hand the player pushed onheld_bankroll - the unchanged bankroll of the player
public void playerWinsInsurance(int amount_won,
int new_bankroll)
PlayerObserver
playerWinsInsurance in interface PlayerObserveramount_won - the amount the player wonnew_bankroll - the new bankroll of the player, after adding the winning
public void playerLosesInsurance(int amount_lost,
int new_bankroll)
PlayerObserver
playerLosesInsurance in interface PlayerObserveramount_lost - 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 | |||||||||