|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object blackjackanalyst.strategy.BasicStrategyPlayer
public class BasicStrategyPlayer
A player that uses basic strategy correctly, provided the following table options:
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface blackjackanalyst.PlayerStrategy |
---|
PlayerStrategy.PlayerStrategyAction |
Constructor Summary | |
---|---|
BasicStrategyPlayer()
|
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 curr_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. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BasicStrategyPlayer()
Method Detail |
---|
public PlayerStrategy.PlayerStrategyAction getAction(PlayerHand player_hand, Card dealer_card)
PlayerStrategy
null
, the caller determines what action is taken.
getAction
in interface PlayerStrategy
player_hand
- the hand of cards belonging to the playerdealer_card
- the card shown by the dealer
public void shoeShuffled()
PlayerStrategy
shoeShuffled
in interface PlayerStrategy
public void cardDealt(Card dealt_card)
PlayerStrategy
cardDealt
in interface PlayerStrategy
dealt_card
- the card that was dealtpublic void joinedTable(Table t)
PlayerStrategy
joinedTable
in interface PlayerStrategy
t
- the table the player has joinedpublic void leftTable(Table t)
PlayerStrategy
leftTable
in interface PlayerStrategy
t
- the table the player has leftpublic int getBet(int bankroll)
PlayerStrategy
0
and less than or equal to bankroll
.
getBet
in interface PlayerStrategy
bankroll
- the current bankroll of the player
public int getInsuranceBet(PlayerHand curr_hand, int bet_amount)
PlayerStrategy
0
, no insurance is taken.
getInsuranceBet
in interface PlayerStrategy
curr_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 |