blackjackanalyst
Interface PlayerObserver

All Known Implementing Classes:
AbstractPlayerObserver, ConsolePlayerObserver, WinLossPlayerObserver

public interface PlayerObserver

An interface that allows observation of a player.

Author:
Michael Parker

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 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.
 

Method Detail

playerJoins

void playerJoins(Table t)
This method is invoked when the player joins a table.

Parameters:
t - the table the player has joined

playerLeaves

void playerLeaves(Table t)
This method is invoked when the player leaves the table it had previously joined.

Parameters:
t - the table the player has left

playerBets

void playerBets(int bet_amount,
                int bankroll)
This method is invoked when the player makes a bet.

Parameters:
bet_amount - the amount the player bet
bankroll - the bankroll of the player, which includes the amount bet

playerInsures

void playerInsures(int bet_amount,
                   int bankroll)
This method is invoked when the player makes his insurance bet.

Parameters:
bet_amount - the amount the player insures
bankroll - the bankroll of the player, which includes the amount bet

playerDealt

void playerDealt(PlayerHand player_hand)
This method is invoked when the player is dealt a new hand.

Parameters:
player_hand - the hand dealt to the player

playerDraws

void playerDraws(Card dealt_card,
                 PlayerHand new_hand)
This method is invoked when the player hits and is drawn a new card.

Parameters:
dealt_card - the new card the player draws
new_hand - the player hand including the drawn card

playerStands

void playerStands(PlayerHand player_hand)
This method is invoked when the player stands.

Parameters:
player_hand - the player hand stood with

playerBusts

void playerBusts(PlayerHand player_hand,
                 int amount_lost,
                 int new_bankroll)
This method is invoked when the player busts.

Parameters:
player_hand - the player hand busted with
amount_lost - the amount the player lost
new_bankroll - the new bankroll of the player, after subtracting the loss

playerSplits

void playerSplits(PlayerHand player_hand)
This method is invoked when the player splits the hand.

Parameters:
player_hand - the player hand that was split

playerDoublesDown

void playerDoublesDown(Card dealt_card,
                       PlayerHand new_hand)
This method is invoked when the player doubles down and is drawn a final card.

Parameters:
dealt_card - the final card the player draws
new_hand - the player hand including the drawn card

playerWins

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.

Parameters:
player_hand - the hand the player won on
amount_won - the amount the player won
new_bankroll - the new bankroll of the player, after adding the winning

playerLoses

void playerLoses(PlayerHand player_hand,
                 int amount_lost,
                 int new_bankroll)
This method is invoked when the observed player loses.

Parameters:
player_hand - the hand the player lost on
amount_lost - the amount the player lost
new_bankroll - the new bankroll of the player, after subtracting the loss

playerBlackjack

void playerBlackjack(PlayerHand player_hand,
                     int amount_won,
                     int new_bankroll)
This method is invoked when the observed player gets a blackjack.

Parameters:
player_hand - the hand the player received blackjack on
amount_won - the amount the player won on blackjack
new_bankroll - the new bankroll of the player, after adding the winning

playerPush

void playerPush(PlayerHand player_hand,
                int held_bankroll)
This method is invoked when the observed player ties the dealer, or pushes.

Parameters:
player_hand - the hand the player pushed on
held_bankroll - the unchanged bankroll of the player

playerWinsInsurance

void playerWinsInsurance(int amount_won,
                         int new_bankroll)
This method is invoked when the observed player wins his insurance bet.

Parameters:
amount_won - the amount the player won
new_bankroll - the new bankroll of the player, after adding the winning

playerLosesInsurance

void playerLosesInsurance(int amount_lost,
                          int new_bankroll)
This method is invoked when the observed player loses his insurance bet.

Parameters:
amount_lost - the amount the player lost
new_bankroll - the new bankroll of the player, after subtracting the loss