|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectca.ualberta.cs.poker.free.dynamics.PokerDynamics
public class PokerDynamics
Field Summary | |
---|---|
double[] |
amountWon
|
java.lang.String |
bettingSequence
|
Card[] |
board
Full board (may not have been revealed) |
boolean |
firstActionOnRound
The next action will be the first action on the round. |
int |
handNumber
|
boolean |
handOver
The hand is over |
Card[][] |
hole
Cards in the hole |
double[] |
inPot
inPot[i] is the contribution to the pot of the player in seat i. |
int |
roundBets
|
int |
roundIndex
Round index incremented when the cards for that round are dealt. |
int |
seatToAct
|
int |
winnerIndex
|
Constructor Summary | |
---|---|
PokerDynamics()
|
|
PokerDynamics(java.security.SecureRandom random)
Creates a new instance of PokerServer |
Method Summary | |
---|---|
void |
addToPot(double amount,
int seat)
|
void |
dealCards()
Sets all cards from the SecureRandom device |
void |
endHand()
After winnerIndex is set, we can end the hand. |
java.lang.String |
getCardState(int seat)
If seat==2, we want all the card info for the logs, this assumes we will only use seat==2 when the server wants logging info, otherwise 0 or 1 |
java.lang.String |
getMatchState(int seat)
|
int |
getOtherSeat(int seat)
|
int |
getWinner()
Returns: -1 on a tie, 0 if first seat has a better hand, 1 if second seat has a better hand. |
void |
handleAction(char action)
|
void |
handleCall()
Updates the state when a call is made. |
void |
handleFold()
Updates the state when a (legal) fold is made. |
void |
handleRaise()
Updates the state when a (legal) raise is made. |
void |
incrementRound()
|
void |
initializeBets()
|
boolean |
isFirstSeatVisible(int seat)
The first player's hole cards are visible to the first player always and to everyone at the showdown. |
boolean |
isSecondSeatVisible(int seat)
|
void |
setHandNumber(int handNumber)
|
void |
startHand()
|
void |
startHand(java.io.BufferedReader cardFile)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public double[] inPot
public double[] amountWon
public int roundBets
public java.lang.String bettingSequence
public int seatToAct
public int roundIndex
public boolean firstActionOnRound
public boolean handOver
public int winnerIndex
public Card[][] hole
public Card[] board
public int handNumber
Constructor Detail |
---|
public PokerDynamics(java.security.SecureRandom random)
public PokerDynamics()
Method Detail |
---|
public void startHand()
public void startHand(java.io.BufferedReader cardFile)
public void dealCards()
public int getOtherSeat(int seat)
public void addToPot(double amount, int seat)
public void initializeBets()
public void incrementRound()
public java.lang.String getMatchState(int seat)
public boolean isFirstSeatVisible(int seat)
public boolean isSecondSeatVisible(int seat)
public java.lang.String getCardState(int seat)
seat
-
public void handleCall()
public void handleRaise()
public void handleFold()
public void handleAction(char action)
public int getWinner()
public void endHand()
public void setHandNumber(int handNumber)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |