blackjackanalyst.observer
Class AbstractTableObserver

java.lang.Object
  extended by blackjackanalyst.observer.AbstractTableObserver
All Implemented Interfaces:
TableObserver

public abstract class AbstractTableObserver
extends java.lang.Object
implements TableObserver

An abstract class that defines an empty body for each method of interface TableObserver. Concrete implementations that are only interested in select methods of the interface can extend this class for clarity and convenience.

Author:
Michael Parker

Constructor Summary
AbstractTableObserver()
           
 
Method Summary
 void dealerBlackjack(Hand dealer_hand)
          This method is invoked when the dealer reveals its down card and receives a blackjack.
 void dealerBusts(Hand dealer_hand)
          This method is invoked when the dealer busts.
 void dealerDealt(Card up_card)
          This method is invoked when the dealer is dealt its up card.
 void dealerDealt(Card down_card, Hand dealer_hand)
          This method is invoked when the dealer reveals its down card and does not receive a blackjack.
 void dealerDraws(Card dealt_card, Hand new_hand)
          This method is invoked when the dealer hits and is drawn a new card.
 void dealerStands(Hand dealer_hand)
          This method is invoked when the dealer stands.
 void newRound(java.util.List<Player> players)
          This method is invoked before each new round of blackjack.
 void playerBets(Player betting_player, int bet_amount, int bankroll)
          This method is invoked when a player makes a bet.
 void playerBlackjack(Player dealt_player, PlayerHand player_hand, int amount_won, int new_bankroll)
          This method is invoked when a player gets a blackjack.
 void playerBusts(Player dealt_player, PlayerHand player_hand, int amount_lost, int new_bankroll)
          This method is invoked when a player busts.
 void playerDealt(Player dealt_player, PlayerHand player_hand)
          This method is invoked when a player is dealt a new hand.
 void playerDoublesDown(Player dealt_player, Card dealt_card, PlayerHand new_hand)
          This method is invoked when a player doubles down and is drawn a final card.
 void playerDraws(Player dealt_player, Card dealt_card, PlayerHand new_hand)
          This method is invoked when a player hits and is drawn a new card.
 void playerInsures(Player betting_player, int bet_amount, int new_bankroll)
          This method is invoked when a player makes his insurance bet.
 void playerJoins(Player joined_player)
          This method is invoked when a player joins a table.
 void playerLeaves(Player left_player)
          This method is invoked when a player leaves the table.
 void playerLoses(Player dealt_player, PlayerHand player_hand, int amount_lost, int new_bankroll)
          This method is invoked when a player loses.
 void playerLosesInsurance(Player dealt_player, int amount_lost, int new_bankroll)
          This method is invoked when a player loses his insurance bet.
 void playerPush(Player dealt_player, PlayerHand player_hand, int held_bankroll)
          This method is invoked when a player ties the dealer, or pushes.
 void playerSplits(Player dealt_player, PlayerHand player_hand)
          This method is invoked when a player splits the hand.
 void playerStands(Player dealt_player, PlayerHand player_hand)
          This method is invoked when a player stands.
 void playerWins(Player dealt_player, PlayerHand player_hand, int amount_won, int new_bankroll)
          This method is invoked when a player wins, but does not get blackjack.
 void playerWinsInsurance(Player dealt_player, int amount_won, int new_bankroll)
          This method is invoked when a player wins his insurance bet.
 void shoeShuffled()
          This method is invoked when the shoe is shuffled.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractTableObserver

public AbstractTableObserver()
Method Detail

newRound

public void newRound(java.util.List<Player> players)
Description copied from interface: TableObserver
This method is invoked before each new round of blackjack.

Specified by:
newRound in interface TableObserver
Parameters:
players - the players playing this round

shoeShuffled

public void shoeShuffled()
Description copied from interface: TableObserver
This method is invoked when the shoe is shuffled.

Specified by:
shoeShuffled in interface TableObserver

dealerDealt

public void dealerDealt(Card up_card)
Description copied from interface: TableObserver
This method is invoked when the dealer is dealt its up card.

Specified by:
dealerDealt in interface TableObserver
Parameters:
up_card - the up card of the dealer

dealerDealt

public void dealerDealt(Card down_card,
                        Hand dealer_hand)
Description copied from interface: TableObserver
This method is invoked when the dealer reveals its down card and does not receive a blackjack.

Specified by:
dealerDealt in interface TableObserver
Parameters:
down_card - the revealed down card of the dealer
dealer_hand - the dealer hand, including both its up and down card

dealerBlackjack

public void dealerBlackjack(Hand dealer_hand)
Description copied from interface: TableObserver
This method is invoked when the dealer reveals its down card and receives a blackjack.

Specified by:
dealerBlackjack in interface TableObserver
Parameters:
dealer_hand - the dealer hand that is a blackjack

dealerDraws

public void dealerDraws(Card dealt_card,
                        Hand new_hand)
Description copied from interface: TableObserver
This method is invoked when the dealer hits and is drawn a new card.

Specified by:
dealerDraws in interface TableObserver
Parameters:
dealt_card - the new card the dealer draws
new_hand - the dealer hand including its drawn card

dealerStands

public void dealerStands(Hand dealer_hand)
Description copied from interface: TableObserver
This method is invoked when the dealer stands.

Specified by:
dealerStands in interface TableObserver
Parameters:
dealer_hand - the hand the dealer stood with

dealerBusts

public void dealerBusts(Hand dealer_hand)
Description copied from interface: TableObserver
This method is invoked when the dealer busts.

Specified by:
dealerBusts in interface TableObserver
Parameters:
dealer_hand - the hand the dealer busted with

playerJoins

public void playerJoins(Player joined_player)
Description copied from interface: TableObserver
This method is invoked when a player joins a table.

Specified by:
playerJoins in interface TableObserver
Parameters:
joined_player - the player that has joined the table

playerLeaves

public void playerLeaves(Player left_player)
Description copied from interface: TableObserver
This method is invoked when a player leaves the table.

Specified by:
playerLeaves in interface TableObserver
Parameters:
left_player - the player that has left the table

playerBets

public void playerBets(Player betting_player,
                       int bet_amount,
                       int bankroll)
Description copied from interface: TableObserver
This method is invoked when a player makes a bet.

Specified by:
playerBets in interface TableObserver
Parameters:
betting_player - the player that has made a bet
bet_amount - the amount the player bet
bankroll - the bankroll of the player, which includes the amount bet

playerInsures

public void playerInsures(Player betting_player,
                          int bet_amount,
                          int new_bankroll)
Description copied from interface: TableObserver
This method is invoked when a player makes his insurance bet.

Specified by:
playerInsures in interface TableObserver
Parameters:
betting_player - the player that has made an insurance bet
bet_amount - the amount the player insures
new_bankroll - the bankroll of the player, which includes the amount bet

playerDealt

public void playerDealt(Player dealt_player,
                        PlayerHand player_hand)
Description copied from interface: TableObserver
This method is invoked when a player is dealt a new hand.

Specified by:
playerDealt in interface TableObserver
Parameters:
dealt_player - the player that was dealt a hand
player_hand - the hand dealt to the player

playerDraws

public void playerDraws(Player dealt_player,
                        Card dealt_card,
                        PlayerHand new_hand)
Description copied from interface: TableObserver
This method is invoked when a player hits and is drawn a new card.

Specified by:
playerDraws in interface TableObserver
Parameters:
dealt_player - the player that draws a card
dealt_card - the new card the player draws
new_hand - the player hand including the drawn card

playerStands

public void playerStands(Player dealt_player,
                         PlayerHand player_hand)
Description copied from interface: TableObserver
This method is invoked when a player stands.

Specified by:
playerStands in interface TableObserver
Parameters:
dealt_player - the player that stands
player_hand - the player hand stood with

playerBusts

public void playerBusts(Player dealt_player,
                        PlayerHand player_hand,
                        int amount_lost,
                        int new_bankroll)
Description copied from interface: TableObserver
This method is invoked when a player busts.

Specified by:
playerBusts in interface TableObserver
Parameters:
dealt_player - the player that busts
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

public void playerSplits(Player dealt_player,
                         PlayerHand player_hand)
Description copied from interface: TableObserver
This method is invoked when a player splits the hand.

Specified by:
playerSplits in interface TableObserver
Parameters:
dealt_player - the player that splits
player_hand - the player hand that was split

playerDoublesDown

public void playerDoublesDown(Player dealt_player,
                              Card dealt_card,
                              PlayerHand new_hand)
Description copied from interface: TableObserver
This method is invoked when a player doubles down and is drawn a final card.

Specified by:
playerDoublesDown in interface TableObserver
Parameters:
dealt_player - the player that doubles down
dealt_card - the final card the player draws
new_hand - the player hand including the drawn card

playerWins

public void playerWins(Player dealt_player,
                       PlayerHand player_hand,
                       int amount_won,
                       int new_bankroll)
Description copied from interface: TableObserver
This method is invoked when a player wins, but does not get blackjack.

Specified by:
playerWins in interface TableObserver
Parameters:
dealt_player - the player that won
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

public void playerLoses(Player dealt_player,
                        PlayerHand player_hand,
                        int amount_lost,
                        int new_bankroll)
Description copied from interface: TableObserver
This method is invoked when a player loses.

Specified by:
playerLoses in interface TableObserver
Parameters:
dealt_player - the player that lost
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

public void playerBlackjack(Player dealt_player,
                            PlayerHand player_hand,
                            int amount_won,
                            int new_bankroll)
Description copied from interface: TableObserver
This method is invoked when a player gets a blackjack.

Specified by:
playerBlackjack in interface TableObserver
Parameters:
dealt_player - the player that got a blackjack
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

public void playerPush(Player dealt_player,
                       PlayerHand player_hand,
                       int held_bankroll)
Description copied from interface: TableObserver
This method is invoked when a player ties the dealer, or pushes.

Specified by:
playerPush in interface TableObserver
Parameters:
dealt_player - the player that tied the dealer
player_hand - the hand the player pushed on
held_bankroll - the unchanged bankroll of the player

playerWinsInsurance

public void playerWinsInsurance(Player dealt_player,
                                int amount_won,
                                int new_bankroll)
Description copied from interface: TableObserver
This method is invoked when a player wins his insurance bet.

Specified by:
playerWinsInsurance in interface TableObserver
Parameters:
dealt_player - the player that won insurance
amount_won - the amount the player won
new_bankroll - the new bankroll of the player, after adding the winning

playerLosesInsurance

public void playerLosesInsurance(Player dealt_player,
                                 int amount_lost,
                                 int new_bankroll)
Description copied from interface: TableObserver
This method is invoked when a player loses his insurance bet.

Specified by:
playerLosesInsurance in interface TableObserver
Parameters:
dealt_player - the player that lost insurance
amount_lost - the amount the player lost
new_bankroll - the new bankroll of the player, after subtracting the loss