|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface PlayerStrategy
An interface to be implemented by a user-defined player strategy. A player strategy defines what action a player takes given a hand of cards.
Nested Class Summary | |
---|---|
static class |
PlayerStrategy.PlayerStrategyAction
The possible player actions, which are hit, stand, double down, and split. |
Method Summary | |
---|---|
void |
cardDealt(Card dealt_card)
This informs the strategy that the given card has been dealt to some player. |
PlayerStrategy.PlayerStrategyAction |
getAction(PlayerHand player_hand,
Card dealer_card)
Returns the proper action, given the current hand. |
int |
getBet(int bankroll)
Notifies the player that a new betting round has started. |
int |
getInsuranceBet(PlayerHand player_hand,
int bet_amount)
Notifies the player that the dealer is showing an ace as his up card and is offering insurance. |
void |
joinedTable(Table t)
This informs the strategy that the player has now joined a table. |
void |
leftTable(Table t)
This informs the strategy that the player has now left the table it previously joined. |
void |
shoeShuffled()
This informs the strategy that the shoe has been shuffled. |
Method Detail |
---|
PlayerStrategy.PlayerStrategyAction getAction(PlayerHand player_hand, Card dealer_card)
null
, the caller determines what action is taken.
player_hand
- the hand of cards belonging to the playerdealer_card
- the card shown by the dealer
void shoeShuffled()
void cardDealt(Card dealt_card)
dealt_card
- the card that was dealtvoid joinedTable(Table t)
t
- the table the player has joinedvoid leftTable(Table t)
t
- the table the player has leftint getBet(int bankroll)
0
and less than or equal to bankroll
.
bankroll
- the current bankroll of the player
int getInsuranceBet(PlayerHand player_hand, int bet_amount)
0
, no insurance is taken.
player_hand
- the hand of cards belonging to the playerbet_amount
- the amount bet on the player hand
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |