|
||||||||||
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. |
int |
bigBlind()
Big Blind the current player |
int |
call()
Call the current player |
boolean |
canRaise()
Determine if the current player is allowed to raise. |
void |
clearSeat(int seat)
|
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. |
int |
getAmountToCall(int pos)
Get the amount a player must call to stay in |
int |
getBetAmount()
Obtain the total amount players must have in the pot to stay in |
java.util.ArrayList |
getBetList()
A list containing the size of each bet/raise made through the hand. |
int |
getBetSize()
Get the current size of the bet. |
double |
getBetsToCall(int pos)
Get the number of bets a player must call to stay in |
int |
getBigBet()
Get the size of a big bet (usually double the big-blind). |
int |
getBigBlindSeat()
|
int |
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 |
getCurrentPlayerPosition()
|
int |
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. |
int |
getHandRank(Card c1,
Card c2)
Look up a the rank of a hand against the current board |
int[][] |
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. |
int |
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(int amountIn)
Get the number of players eligible to win the pot where the stakes for the pot are below the given amount. |
int |
getPot()
Get the total size of the pot, including all side pots |
int |
getRaiseAmount(int amountToRaise)
Return the amount the current player can raise, given the desired amount to raise. |
Reporter |
getReporter()
Get the Reporter used for all game debug output |
java.lang.String |
getSequence()
Get the entire betting sequence of the hand. |
int |
getSmallBet()
Get the size of a small bet (the big-blind). |
int |
getSmallBlindSeat()
|
int |
getSmallBlindSize()
Get the size of a small blind. |
int |
getStage()
|
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 |
void |
payPot(int 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 |
int |
raise(int 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. |
int |
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 |
boolean |
seatEmpty(int seat)
Test if a player is in this seat or not. |
void |
setBigBlindSeat(int i)
Set the position of the big blind seat. |
void |
setButton(int i)
Set the Button. |
void |
setCurrentPlayerPosition(int cp)
Set the current player position |
void |
setLimits(int smallBlind,
int smallBet,
int bigBet)
Set the betting limits for the game. |
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(int p)
Set the pot size |
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. |
int |
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 |
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 Reporter getReporter()
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 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 int getSmallBlindSize()
public int getBigBlindSize()
public void setLimits(int smallBlind, int smallBet, int bigBet)
smallBlind
- the size of the small blindsmallBet
- the size of the small bet / big blindbigBet
- the size of the big betpublic int getSmallBet()
public int getBigBet()
public int getStage()
public boolean isPreFlop()
public boolean isFlop()
public boolean isTurn()
public boolean isRiver()
public boolean isPostFlop()
public int getPot()
public void setPot(int p)
public int getID()
public 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 getCurrentPlayerPosition()
public void setCurrentPlayerPosition(int cp)
cp
- the position to make current.public int advanceCurrentPlayer()
public int nextPlayer(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 int getMinRaise()
public void allInPass()
public boolean fold()
public void muck(int seat)
seat
- the seat to muckpublic int smallBlind()
public int bigBlind()
public int call()
public int getRaiseAmount(int amountToRaise)
amountToRaise
- the desired amount to raise.
public int raise(int 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 int getAmountToCall(int pos)
pos
- the position of the player
public double getBetsToCall(int pos)
pos
- the position of the player
public boolean playerCommitted(int pos)
pos
- the position of the player
public int getBetAmount()
public int getBetSize()
public int[][] getHandRanks()
public int getHandRank(Card c1, Card c2)
public int getNumToAct()
public java.lang.String getSequence()
public final int getNumSeats()
public boolean useReverseBlinds()
public void moveButtonBack()
public boolean canRaise()
public PlayerInfo getFirstPlayerWithMostIn()
public int getNumberOfAllInPlayers()
public int getNumActivePlayersNotAllIn()
public java.util.ArrayList getPlayersInPot(int amountIn)
amountIn
- the stakes for the pots to count
public int getEligiblePot(int playerID)
playerID
- the player ID
public Pot getMainPot()
public void payPot(int amount, PlayerInfo pi)
amount
- the amount to put in the potpi
- the player who is payingpublic int removeUncalledChips()
public int getNumPlayersWithChips()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |