|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.gbayer.basicblackjack.Player
com.gbayer.basicblackjack.HumanPlayer
public class HumanPlayer
A human Player
that takes action based on UI prompts.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.gbayer.basicblackjack.Player |
---|
Player.Action |
Field Summary | |
---|---|
static int |
INVALID_BET_FLAG
Constant - Flag indicating that no bet has been placed. |
Constructor Summary | |
---|---|
HumanPlayer(java.lang.String name,
int startingChips)
Instantiates a new human player. |
Method Summary | |
---|---|
void |
betChips(int chips)
Bet chips. |
int |
getChipCount()
Gets the player's current chip count. |
void |
looseBet()
Player looses bet. |
Player.Action |
takeAction(UI ui)
Human player takes action based on UI prompts. |
void |
winBet()
Player wins bet. |
Methods inherited from class com.gbayer.basicblackjack.Player |
---|
dealCard, getHand, getName, newHand, toString, toStringShowingTopCardOnly |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int INVALID_BET_FLAG
Constructor Detail |
---|
public HumanPlayer(java.lang.String name, int startingChips)
name
- the player's namestartingChips
- number of starting chipsMethod Detail |
---|
public Player.Action takeAction(UI ui)
takeAction
in class Player
ui
- the user interface
public int getChipCount()
public void betChips(int chips)
chips
- the number of chipspublic void winBet()
public void looseBet()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |