ca.ualberta.cs.poker.free.academy25
Class GameInfoImpl

java.lang.Object
  extended by ca.ualberta.cs.poker.free.academy25.GameInfoImpl

public class GameInfoImpl
extends java.lang.Object


Field Summary
 PlayerInfoDynamics[] players
           
 
Constructor Summary
GameInfoImpl(GameInfoDynamics dynamics)
           
 
Method Summary
 boolean canRaise(int seat)
          You can raise if there are less than 4 bets on this round and the number of active players is 2 (everybody).
static Hand convertToHand(Card[] cards)
          Convert old cards to new cards.
 double getAmountToCall(int seat)
          The amount to call is the different between the stake and the pot of seat: however, if someone has folded (is inactive), it is zero.
 double getAnte()
          There are no antes in the variant we are playing, so this returns zero.
 double getBankRoll(int seat)
          Returns the current bankroll of a player.
 double getBankRollAtRisk(int seat)
          This function is primarily for no-limit games, and therefore there is no formal specification here and its use is not recommended.
 double getBetsToCall(int seat)
          The amount to call, except in terms of the current bet size.
 int getBigBlindSeat()
          The seat that has or will submit the big blind.
 double getBigBlindSize()
          The size of the big blind, equal to the size of the small bet.
 Hand getBoard()
          Returns the visible board.
 int getButtonSeat()
          Gets the seat with the button.
 double getCurrentBetSize()
          If the current round is the pre-flop or the flop, this is the small bet.
 int getCurrentPlayerSeat()
          Returns the player who is about to act (during getAction) or who has just acted (during actionEvent or gameStateChanged)
 double getEligiblePot(int seat)
          Returns the total pot size (infinite bankroll)
 long getGameID()
          Returns a long between 0 and 999
 java.lang.String getLogDirectory()
          There is no log directory in this implementation.
 double getMainPotSize()
          Same as the total pot size.
 double getMinRaise()
          Same as the current bet size.
 double getNetGain(int seat)
          Gets the net gain Returns zero if the game is over.
 int getNumActivePlayers()
           
 int getNumActivePlayersNotAllIn()
           
 int getNumberOfAllInPlayers()
           
 int getNumPlayers()
           
 int getNumRaises()
           
 int getNumSeats()
           
 int getNumSidePots()
           
 int getNumToAct()
           
 int getNumWinners()
           
 PlayerInfo getPlayer(int seat)
          Returns the player info for a player sitting in the seat.
 PlayerInfo getPlayer(java.lang.String name)
          Returns the player info for a player with a particular name (names are "0" and "1").
 java.lang.String getPlayerName(int seat)
          Returns the name for a player in a seat (names are "0" and "1").
 int getPlayerSeat(java.lang.String name)
           
 java.util.List getPlayersInPot(double amountIn)
          A PlayerInfo is in the list iff they put amountIn or more into the pot themselves.
 double getRake()
          No rake for the competition
 double getSidePotSize(int i)
           
 int getSmallBlindSeat()
          Gets the small blind seat (the button).
 double getSmallBlindSize()
          Returns the small blind size.
 int getStage()
          Returns the stage: Holdem.PREFLOP, Holdem.FLOP, Holdem.TURN, or Holdem.RIVER (0-3)
 double getStakes()
          The largest amount any individual put in the pot this hand.
 double getTotalPotSize()
          The total pot size.
 int getUnacted()
          How many players have not folded, checked, called, bet, or raised this stage?
 boolean inGame(int seat)
          Both players are always in the game
 boolean isActive(int seat)
          All players are active in heads-up
 boolean isCommitted(int seat)
          Has the player bet more than his own blind in this stage?
 boolean isFixedLimit()
          The tournament is fixed limit
 boolean isFlop()
          Flop indicates the postflop
 boolean isGameOver()
           
 boolean isNoLimit()
          The tournament is fixed limit, not "no limit"
 boolean isPostFlop()
          Returns true if the flop has been dealt but not the turn card (after stageEvent(1), before stageEvent(2))
 boolean isPotLimit()
          The tournament is fixed limit, not "pot limit"
 boolean isPreFlop()
          Returns true if the river card has been dealt (after stageEvent(1), before stageEvent(2))
 boolean isReverseBlinds()
          The tournament is reverse blinds, where the button gives a small blind.
 boolean isRiver()
          Returns true if the river card has been dealt (after stageEvent(3))
 boolean isSimulation()
          The tournament is not simulation.
 boolean isTurn()
           
 boolean isZipMode()
          The tournament is not "zip mode".
static int nameToSeat(java.lang.String name)
          Since names are simply a string with the player index, it is all good.
 int nextActivePlayer(int seat)
          The next active player.
 int nextPlayer(int seat)
          Return the other seat.
 int nextSeat(int seat)
          Since there are only two seats, the next seat from 1 is 0.
 int previousPlayer(int seat)
          The previous player is the other player.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

players

public PlayerInfoDynamics[] players
Constructor Detail

GameInfoImpl

public GameInfoImpl(GameInfoDynamics dynamics)
Method Detail

nameToSeat

public static int nameToSeat(java.lang.String name)
Since names are simply a string with the player index, it is all good.


getNetGain

public double getNetGain(int seat)
Gets the net gain Returns zero if the game is over.


canRaise

public boolean canRaise(int seat)
You can raise if there are less than 4 bets on this round and the number of active players is 2 (everybody).


getAmountToCall

public double getAmountToCall(int seat)
The amount to call is the different between the stake and the pot of seat: however, if someone has folded (is inactive), it is zero.


getAnte

public double getAnte()
There are no antes in the variant we are playing, so this returns zero.


getBankRoll

public double getBankRoll(int seat)
Returns the current bankroll of a player. A player's bankroll is decremented with each blind, call, or raise it makes, and is incremented right before its own winEvent()


getBankRollAtRisk

public double getBankRollAtRisk(int seat)
This function is primarily for no-limit games, and therefore there is no formal specification here and its use is not recommended.


getBetsToCall

public double getBetsToCall(int seat)
The amount to call, except in terms of the current bet size.


getBigBlindSeat

public int getBigBlindSeat()
The seat that has or will submit the big blind. This is non-button seat.


getBigBlindSize

public double getBigBlindSize()
The size of the big blind, equal to the size of the small bet.


getBoard

public Hand getBoard()
Returns the visible board. Updated before each stageEvent.


getButtonSeat

public int getButtonSeat()
Gets the seat with the button. This seat gives the small blind, bets first on the pre-flop, and bets second in later rounds.


getCurrentBetSize

public double getCurrentBetSize()
If the current round is the pre-flop or the flop, this is the small bet. If the current round is turn or the river, this is the river.


getCurrentPlayerSeat

public int getCurrentPlayerSeat()
Returns the player who is about to act (during getAction) or who has just acted (during actionEvent or gameStateChanged)


getEligiblePot

public double getEligiblePot(int seat)
Returns the total pot size (infinite bankroll)


getGameID

public long getGameID()
Returns a long between 0 and 999


getLogDirectory

public java.lang.String getLogDirectory()
There is no log directory in this implementation.


getMainPotSize

public double getMainPotSize()
Same as the total pot size.


getMinRaise

public double getMinRaise()
Same as the current bet size.


getNumActivePlayers

public int getNumActivePlayers()

getNumActivePlayersNotAllIn

public int getNumActivePlayersNotAllIn()

getNumberOfAllInPlayers

public int getNumberOfAllInPlayers()

getNumPlayers

public int getNumPlayers()

getNumRaises

public int getNumRaises()

getNumSeats

public int getNumSeats()

getNumSidePots

public int getNumSidePots()

getNumToAct

public int getNumToAct()

getNumWinners

public int getNumWinners()

getPlayer

public PlayerInfo getPlayer(int seat)
Returns the player info for a player sitting in the seat.


getPlayer

public PlayerInfo getPlayer(java.lang.String name)
Returns the player info for a player with a particular name (names are "0" and "1").


getPlayerName

public java.lang.String getPlayerName(int seat)
Returns the name for a player in a seat (names are "0" and "1").


getPlayerSeat

public int getPlayerSeat(java.lang.String name)

getPlayersInPot

public java.util.List getPlayersInPot(double amountIn)
A PlayerInfo is in the list iff they put amountIn or more into the pot themselves.


getRake

public double getRake()
No rake for the competition


getSidePotSize

public double getSidePotSize(int i)

getSmallBlindSeat

public int getSmallBlindSeat()
Gets the small blind seat (the button). In reverse blinds, the button gets the smallBlind.


getSmallBlindSize

public double getSmallBlindSize()
Returns the small blind size. getSmallBlindSize() * 4 == getBigBlindSize() * 2 == getSmallBetSize() * 2 == getBigBetSize()


getStage

public int getStage()
Returns the stage: Holdem.PREFLOP, Holdem.FLOP, Holdem.TURN, or Holdem.RIVER (0-3)


getStakes

public double getStakes()
The largest amount any individual put in the pot this hand.


getTotalPotSize

public double getTotalPotSize()
The total pot size. All other pot functions call this one.


getUnacted

public int getUnacted()
How many players have not folded, checked, called, bet, or raised this stage?


inGame

public boolean inGame(int seat)
Both players are always in the game


isActive

public boolean isActive(int seat)
All players are active in heads-up


isCommitted

public boolean isCommitted(int seat)
Has the player bet more than his own blind in this stage?


isFixedLimit

public boolean isFixedLimit()
The tournament is fixed limit


isFlop

public boolean isFlop()
Flop indicates the postflop


isGameOver

public boolean isGameOver()

isNoLimit

public boolean isNoLimit()
The tournament is fixed limit, not "no limit"


isPostFlop

public boolean isPostFlop()
Returns true if the flop has been dealt but not the turn card (after stageEvent(1), before stageEvent(2))


isPotLimit

public boolean isPotLimit()
The tournament is fixed limit, not "pot limit"


isPreFlop

public boolean isPreFlop()
Returns true if the river card has been dealt (after stageEvent(1), before stageEvent(2))


isReverseBlinds

public boolean isReverseBlinds()
The tournament is reverse blinds, where the button gives a small blind.


isRiver

public boolean isRiver()
Returns true if the river card has been dealt (after stageEvent(3))


isSimulation

public boolean isSimulation()
The tournament is not simulation.


isTurn

public boolean isTurn()

isZipMode

public boolean isZipMode()
The tournament is not "zip mode".


nextActivePlayer

public int nextActivePlayer(int seat)
The next active player.


nextPlayer

public int nextPlayer(int seat)
Return the other seat.


nextSeat

public int nextSeat(int seat)
Since there are only two seats, the next seat from 1 is 0.


previousPlayer

public int previousPlayer(int seat)
The previous player is the other player.


convertToHand

public static Hand convertToHand(Card[] cards)
Convert old cards to new cards.