|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectpoker.GameInfo
public class GameInfo
Stores all of the info defining a single game of poker. This includes information of the game's players and the cards which are/were dealt. This class can be used to both archive a game's history and its state in progress. This class is a little messy, as it's been incrementally modified over many years.
Field Summary | |
---|---|
java.lang.String |
LOG_DIR
|
static boolean |
USE_REVERSE_BLINDS
|
Constructor Summary | |
---|---|
GameInfo()
Default Constructor |
Method Summary | |
---|---|
boolean |
activePlayer(int seat)
Test if a player at a specific position is active in the game. |
void |
addWinner(java.lang.String name)
Add a player to the list of winners |
int |
advanceCurrentPlayer()
Advance the current player to the next active player in the game. |
void |
allInPass()
the player is all-in, so passes on his action. |
double |
ante(int seat)
Make a player post the ante for the hand. |
double |
bigBlind()
Big Blind the current player |
double |
call()
Call the current player |
boolean |
canRaise()
Determine if the current player is allowed to raise. |
boolean |
canRaise(PlayerInfo pi)
Determine if the player is allowed to raise. |
void |
clearSeat(int seat)
|
void |
copy(GameInfo gi)
Do a deep copy of the given GameInfo. |
void |
flop(Card c1,
Card c2,
Card c3)
Proceed to stage FLOP |
boolean |
fold()
Fold the current player |
void |
gameOver()
Report the end of the game and log player and game history. |
double |
getAmountToCall(int seat)
Get the amount a player must call to stay in |
double |
getAnte()
Get the ante amount for the game |
java.util.ArrayList |
getBetList()
A list containing the size of each bet/raise made through the hand. |
double |
getBetSize()
Get the current size of the bet. |
double |
getBetsToCall(int seat)
Get the number of bets a player must call to stay in |
double |
getBigBet()
Get the size of a big bet (usually double the big-blind). |
int |
getBigBlindSeat()
|
double |
getBigBlindSize()
Get the size of a big blind. |
Hand |
getBoard()
obtain a Hand containing the board cards. |
Card |
getBoardCard(int i)
Obtain the nth card on the table |
int |
getButton()
|
PlayerInfo |
getCurrentPlayerInfo()
|
java.lang.String |
getCurrentPlayerName()
|
int |
getCurrentPlayerSeat()
|
double |
getEligiblePot(int playerID)
Get the amount in the pot, a player is eligble for |
int |
getFirstPlayerAfterButton()
Find the seat of the first player in the game after the button. |
PlayerInfo |
getFirstPlayerWithMostIn()
Find the first player who has the most invested in the pot. |
NChoose2IntTable |
getHandRanks()
Returns a 52x52 array of hand rank values for every hand against the current board; |
int |
getID()
|
Pot |
getMainPot()
Get the main Pot object. |
double |
getMinRaise()
Get the minimum raise amount. |
int |
getNumActivePlayers()
|
int |
getNumActivePlayersNotAllIn()
Get the number of players in the hand that still have chips |
int |
getNumberOfAllInPlayers()
Get the number of players in the hand who are all-in. |
int |
getNumPlayers()
|
int |
getNumPlayersWithChips()
Get the number of players with chips left |
int |
getNumRaises()
|
int |
getNumSeats()
The number of seats at the table. |
int |
getNumToAct()
Get the number of players left to act in the betting round. |
int |
getNumWinners()
|
PlayerInfo |
getPlayerInfo(int i)
Get a PlayerInfo by seat number |
PlayerInfo |
getPlayerInfo(java.lang.String name)
Given a name, obtain the PlayerInfo object for that player |
java.lang.String |
getPlayerName(int p)
Get the player's name from a position |
int |
getPlayerSeat(java.lang.String name)
From a name, find out a player's position |
java.util.ArrayList |
getPlayersInPot(double amountIn)
Get the number of players eligible to win the pot where the stakes for the pot are below the given amount. |
double |
getPot()
Get the total size of the pot, including all side pots |
double |
getRaiseAmount(double amountToRaise)
Return the amount the current player can raise, given the desired amount to raise. |
double |
getRake()
Get the amount raked from the pot |
NChoose2IntTable |
getRankTable(Hand board,
java.lang.String key)
|
java.lang.String |
getSequence()
Get the entire betting sequence of the hand. |
double |
getSmallBet()
Get the size of a small bet (the big-blind). |
int |
getSmallBlindSeat()
|
double |
getSmallBlindSize()
Get the size of a small blind. |
int |
getStage()
|
double |
getStakes()
Obtain the total amount players must have in the pot to stay in |
int |
getUnacted()
Obtain the number of opponents who have not yet acted in this betting round. |
java.lang.String |
getWinners()
|
boolean |
inGame(int seat)
Test if a player is in this game or not. |
boolean |
isFlop()
Get if the game is in the flop stage |
boolean |
isGameOver()
Check if the hand is over or not |
boolean |
isNoCapHU()
Get option to have no cap once it is heads-up |
boolean |
isNoLimit()
Determine if the game is no-limit |
boolean |
isPostFlop()
Get if the game is in a post-flop stage |
boolean |
isPreFlop()
Get if the game is in the pre-flop stage |
boolean |
isRiver()
Get if the game is in the river stage |
boolean |
isSimulation()
Determine if the game is in simulation mode. |
boolean |
isTurn()
Get if the game is in the turn stage |
boolean |
isZipMode()
Zip mode is a flag for bots to think at a reduced capacity where speed of play is valued over quality of decisions. |
PlayerInfo |
loadPlayerInfo(java.lang.String name)
Adds a new player to the game. |
void |
logGame()
Saves all bankrolls at the time of invokation. |
void |
moveButtonBack()
move the button back by one position. |
void |
muck(int seat)
Inform game info that a player has mucked. |
int |
nextActivePlayer(int seat)
Given a position, returns the position of the next active player |
int |
nextPlayer(int pos)
Get the seat of the next player after the given seat |
int |
nextSeat(int pos)
Get the next avaialbe seat number. |
void |
payPot(double amount,
PlayerInfo pi)
Pay an amount to the pot, from the given player |
boolean |
playerCommitted(int pos)
Test if a player has committed in the current betting round. |
int |
previousPlayer(int pos)
Get the seat of the previous player after the given seat |
double |
raise(double amountToRaise)
Raise the current player |
void |
removeAllPlayers()
Remove all the players from the game |
boolean |
removePlayer(java.lang.String name)
Remove a player from the game. |
double |
removeUncalledChips()
Remove all uncalled chips from the pot |
void |
revealHand(int n,
Card c1,
Card c2)
Reveal a players hand in a showdown. |
void |
revealHand(java.lang.String name,
Card c1,
Card c2)
Reveal a players hand in a showdown. |
void |
river(Card c)
Proceed to stage RIVER |
void |
rotateSeats(int hero)
Rotate the seats until the hero seat is in seat 0 |
boolean |
seatEmpty(int seat)
Test if a player is in this seat or not. |
void |
setAnte(double amount)
Set the amount each player must ante to play a hand |
void |
setBigBlindSeat(int i)
Set the position of the big blind seat. |
void |
setButton(int i)
Set the Button. |
void |
setCurrentPlayerSeat(int cp)
Set the current player seat |
void |
setID(int id)
Set the game ID for this hand |
void |
setLimits(double smallBlind,
double smallBet,
double bigBet)
Set the betting limits for the game. |
void |
setLimits(double smallBlind,
double smallBet,
double bigBet,
double ante)
|
void |
setLogDir(java.lang.String s)
Set the Log Directory used by all players for keeping logs |
void |
setNoCapHU(boolean val)
Set option to have no cap once it is heads-up |
void |
setNoLimit(boolean val)
|
boolean |
setPlayer(java.lang.String name,
int seat)
Insert a new player into the game. |
void |
setPot(double p)
Deprecated. Set the pot size |
void |
setRake(double amount)
Set the amount raked from the pot |
void |
setSimulation(boolean val)
Set simulation mode on or off |
void |
setSmallBlindSeat(int i)
Set the position of the small blind seat. |
void |
setZipMode(boolean val)
Zip mode is a flag for bots to think at a reduced capacity, where speed of play is valued over quality of decisions. |
double |
smallBlind()
Small Blind the current player. |
void |
startNewGame()
Before a new game is played, this should always be called. |
void |
startNewGame(int id)
Before a new game is played, this should always be called. |
void |
swapSeats(int i,
int j)
Swap two seats |
void |
turn(Card c)
Proceed to stage TURN |
boolean |
useReverseBlinds()
Find out if we should use reverse blinds or not. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static boolean USE_REVERSE_BLINDS
public java.lang.String LOG_DIR
Constructor Detail |
---|
public GameInfo()
Method Detail |
---|
public void copy(GameInfo gi)
gi
- public void setLogDir(java.lang.String s)
s
- a directory path namepublic void setNoLimit(boolean val)
public boolean isNoLimit()
public boolean isSimulation()
public void setSimulation(boolean val)
public boolean isZipMode()
public void setZipMode(boolean val)
public boolean isNoCapHU()
public void setNoCapHU(boolean val)
public boolean inGame(int seat)
seat
- the seat of the player in question
public boolean seatEmpty(int seat)
seat
- the seat in question
public void startNewGame()
public void startNewGame(int id)
public PlayerInfo loadPlayerInfo(java.lang.String name)
name
- the name of the new player
public boolean setPlayer(java.lang.String name, int seat)
name
- the name of the new playerseat
- the position to insert at (0..numPlayers)
public void clearSeat(int seat)
public boolean removePlayer(java.lang.String name)
name
- the name of the player to remove
public void removeAllPlayers()
public int getButton()
public int getSmallBlindSeat()
public int getBigBlindSeat()
public void setAnte(double amount)
amount
- the ante amountpublic void setButton(int i)
i
- position to become buttonpublic void setSmallBlindSeat(int i)
i
- position to become the small blind (maybe dead)public void setBigBlindSeat(int i)
i
- position to become big blind (maybe dead)public double getSmallBlindSize()
public double getBigBlindSize()
public void setLimits(double smallBlind, double smallBet, double bigBet)
smallBlind
- the size of the small blindsmallBet
- the size of the small bet / big blindbigBet
- the size of the big betpublic void setLimits(double smallBlind, double smallBet, double bigBet, double ante)
public double getSmallBet()
public double getBigBet()
public int getStage()
public boolean isPreFlop()
public boolean isFlop()
public boolean isTurn()
public boolean isRiver()
public boolean isPostFlop()
public double getPot()
public void setPot(double p)
public int getID()
public void setID(int id)
id
- an int ID value for tracking the handpublic int getNumPlayers()
public int getNumActivePlayers()
public int getNumRaises()
public Card getBoardCard(int i)
i
- the card desired {0..4}
public Hand getBoard()
public int getPlayerSeat(java.lang.String name)
name
- the player's name
public java.lang.String getPlayerName(int p)
p
- the position
public java.lang.String getCurrentPlayerName()
public PlayerInfo getPlayerInfo(int i)
public PlayerInfo getPlayerInfo(java.lang.String name)
name
- the player's name
public PlayerInfo getCurrentPlayerInfo()
public int getCurrentPlayerSeat()
public void setCurrentPlayerSeat(int cp)
cp
- the seat to make current.public int advanceCurrentPlayer()
public int nextPlayer(int pos)
pos
- the specified seat
public int nextSeat(int pos)
pos
- the specified seat
public int previousPlayer(int pos)
pos
- the specified seat
public int nextActivePlayer(int seat)
seat
- specified position
public boolean activePlayer(int seat)
seat
- the position to check.
public double getMinRaise()
public void allInPass()
public boolean fold()
public void muck(int seat)
seat
- the seat to muckpublic double getAnte()
public double ante(int seat)
public double getRake()
public void setRake(double amount)
public double smallBlind()
public double bigBlind()
public double call()
public double getRaiseAmount(double amountToRaise)
amountToRaise
- the desired amount to raise.
public double raise(double amountToRaise)
amountToRaise
- the amount being raised
public java.util.ArrayList getBetList()
public void flop(Card c1, Card c2, Card c3)
c1
- table card 1c2
- table card 2c3
- table card 3public void turn(Card c)
c
- table card 4public void river(Card c)
c
- table card 4public void gameOver()
public boolean isGameOver()
public void logGame()
public void revealHand(java.lang.String name, Card c1, Card c2)
name
- the name of the playerc1
- the first cardc2
- the second cardpublic void revealHand(int n, Card c1, Card c2)
n
- the position of the playerc1
- the first cardc2
- the second cardpublic void addWinner(java.lang.String name)
name
- the name of the player.public java.lang.String getWinners()
public int getNumWinners()
public int getUnacted()
public int getFirstPlayerAfterButton()
public double getAmountToCall(int seat)
seat
- the seat of the player
public double getBetsToCall(int seat)
seat
- the seat of the player
public boolean playerCommitted(int pos)
pos
- the position of the player
public double getStakes()
public double getBetSize()
public NChoose2IntTable getHandRanks()
public NChoose2IntTable getRankTable(Hand board, java.lang.String key)
public int getNumToAct()
public java.lang.String getSequence()
public final int getNumSeats()
public boolean useReverseBlinds()
public void moveButtonBack()
public boolean canRaise()
public boolean canRaise(PlayerInfo pi)
public PlayerInfo getFirstPlayerWithMostIn()
public int getNumberOfAllInPlayers()
public int getNumActivePlayersNotAllIn()
public java.util.ArrayList getPlayersInPot(double amountIn)
amountIn
- the stakes for the pots to count
public double getEligiblePot(int playerID)
playerID
- the player ID
public Pot getMainPot()
public void payPot(double amount, PlayerInfo pi)
amount
- the amount to put in the potpi
- the player who is payingpublic double removeUncalledChips()
public int getNumPlayersWithChips()
public void rotateSeats(int hero)
hero
- public void swapSeats(int i, int j)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |