|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--poker.Dealer
This is a standard dealer class for managing a Holdem game. Does not (yet) handle 'all-In' situations
Field Summary | |
protected java.util.Hashtable |
bettors
|
protected Deck |
gDeck
|
protected GameInfo |
gInfo
|
protected Hand[] |
holes
|
protected Reporter |
r
|
Constructor Summary | |
Dealer()
Constructor. |
|
Dealer(int seed)
Constructor w/ random seed. |
Method Summary | |
boolean |
addPlayer(java.lang.String name,
Player b)
Add a player to the next game (if there is room) |
protected boolean |
betLoop()
|
void |
dealCards()
|
GameInfo |
getGameInfo()
Obtain the game info for the current game. |
int |
getToAct()
|
boolean |
inGame(java.lang.String name)
Check if a player with a given name is already in the game. |
boolean |
insertPlayer(java.lang.String name,
Player b,
int pos)
Add a player to the next game (if there is room) |
Card |
nextBoardCard()
|
static java.lang.String |
pad(java.lang.String s,
int size)
|
void |
playGame()
Play one game of poker with the current set of players |
protected void |
print(java.lang.String s)
|
protected void |
println(java.lang.String s)
|
void |
printTable()
|
void |
removeAllPlayers()
Remove all players from the next game. |
boolean |
removePlayer(java.lang.String name)
Remove a player from the next game. |
void |
run()
|
void |
setSeed(int seed)
|
void |
setThreaded(boolean th)
|
protected void |
showdown()
|
protected void |
updatePlayers(int action,
int code)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected Reporter r
protected GameInfo gInfo
protected Deck gDeck
protected java.util.Hashtable bettors
protected Hand[] holes
Constructor Detail |
public Dealer()
public Dealer(int seed)
seed
- the random seed to use for deck shufflingMethod Detail |
public void setThreaded(boolean th)
public void setSeed(int seed)
public boolean addPlayer(java.lang.String name, Player b)
name
- the name of the player to addb
- the actual player which will make decisionspublic boolean insertPlayer(java.lang.String name, Player b, int pos)
name
- the name of the player to addb
- the actual player which will make decisionspublic boolean removePlayer(java.lang.String name)
name
- the name of the playerpublic void removeAllPlayers()
public GameInfo getGameInfo()
public boolean inGame(java.lang.String name)
name
- the player name to checkpublic void printTable()
public void dealCards()
public Card nextBoardCard()
public void playGame()
public int getToAct()
protected boolean betLoop()
protected void showdown()
public void run()
run
in interface java.lang.Runnable
protected void updatePlayers(int action, int code)
protected void println(java.lang.String s)
protected void print(java.lang.String s)
public static java.lang.String pad(java.lang.String s, int size)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |