| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectblackjackanalyst.observer.WinLossPlayerObserver
public class WinLossPlayerObserver
A player observer that records the number of wins and losses a player has had.
| Constructor Summary | |
|---|---|
| WinLossPlayerObserver()Creates a new player observer that gathers statistics. | |
| Method Summary | |
|---|---|
|  int | getLossStreak()Returns the longest loss streak for this player. | 
|  int | getNetGain()Returns the combined net winnings of this player; a negative number returned indicates a winning house. | 
|  int | getNumBlackjacks()Returns the number of times the player has received a blackjack. | 
|  int | getNumLosses()Returns the number of times the player has lost. | 
|  int | getNumPushes()Returns the number of times the player pushed. | 
|  int | getNumWins()Returns the number of times the player has won, not including blackjacks. | 
|  int | getWinStreak()Returns the longest win streak for this player, which may include blackjacks. | 
|  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. | 
|  void | reset()Resets the statistics recorded by this observer. | 
|  java.lang.String | toString() | 
| Methods inherited from class java.lang.Object | 
|---|
| equals, getClass, hashCode, notify, notifyAll, wait, wait, wait | 
| Constructor Detail | 
|---|
public WinLossPlayerObserver()
| Method Detail | 
|---|
public void reset()
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 losspublic int getNumWins()
public int getNumLosses()
public int getNumBlackjacks()
public int getNumPushes()
public int getWinStreak()
public int getLossStreak()
public int getNetGain()
public java.lang.String toString()
toString in class java.lang.Object| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||