|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.asdf.plugins.pokergames.GameModel
public class GameModel
Contains all the state information of the game and players
Field Summary | |
---|---|
static java.lang.String |
NIL_OBJECT
|
static java.lang.String |
RESERVE_OBJECT
|
Constructor Summary | |
---|---|
GameModel(double smallBlind,
double bigBlind,
int minPlayers,
int maxPlayers,
long gameID,
Stage stage)
Constructor for a new GameModel at the beginning of a table |
|
GameModel(GameModelInfoMessage gmi)
|
Method Summary | |
---|---|
void |
activatePlayer(int player)
|
void |
addCardToBoard(Card card1)
adds the given card to be the last in the board cards |
void |
addRaisesThisRound()
increase the number of raises this round by one |
void |
addToPot(double amount)
|
boolean |
canRaise(int seat)
See if the player in the given seat is able to raise Calls the PlayerInfo's corresponding method. |
static GameModel |
clone(GameModel previous)
|
static GameModel |
clone(GameModelInfoMessage previous)
Little helper who creates an independent copy of given GameModel |
static GameModel |
cloneWithoutPreviousStates(GameModel previous)
|
void |
decreasePlayersToAct()
decrease the number of Players to act by one |
void |
freeSeat(int seat)
|
double |
getAmountToCall(int seat)
Get a player's amount to call Calls the PlayerInfo's corresponding method. |
double |
getAnte()
Get the amount of the ante, if any |
double |
getBankRoll(int seat)
Get a player's bankroll Calls the PlayerInfo's corresponding method. |
double |
getBetsToCall(int seat)
from GameInfo, get the maximum amount the player in the given seat can risk in this hand. |
double |
getBigBlind()
|
int |
getBigBlindSeat()
Get the big blind seat |
int |
getBigBlindSeatFromButton()
|
double |
getBigBlindSize()
Get the amount of the big blind. |
double |
getBiggestBet()
TODO find out what testing |
Hand |
getBoard()
Get the board cards |
Hand |
getBoardCards()
|
int |
getButtonSeat()
Get the seat the button is on (could be dead button) |
int |
getCountablePlayers()
|
double |
getCurrentBetSize()
Get the amount of the betting increment (for fixed-limit) |
PlayerInfo |
getCurrentPlayer()
|
int |
getCurrentPlayerSeat()
Get the seat for the current player to act |
double |
getEligiblePot(int seat)
Get the amount in the pot that a player is eligible to win. |
long |
getGameID()
The game identifier for this table |
GameModelInfoMessage |
getGameModelInfo()
returns the fields of the model, for sending in messages |
boolean |
getIsSimulation()
|
boolean |
getIsZipMode()
|
int |
getLimitStyle()
|
double |
getMainPotSize()
from GameInfo, get the Log Directory used by all players for keeping logs |
int |
getMaxPlayers()
|
int |
getMinPlayers()
|
double |
getMinRaise()
Get the smallest legal raise |
int |
getNumActivePlayers()
Get the number of players still active (not folded) in the hand |
int |
getNumActivePlayersNotAllIn()
Get the number of active players that are not all-in |
int |
getNumberOfAllInPlayers()
Get the number of players in the hand that are all-in |
int |
getNumPlayers()
Get the number of players dealt into the hand |
int |
getNumRaises()
Get the number of bets and raises made during the current betting round |
int |
getNumSeats()
The number of seats at the table |
int |
getNumToAct()
from GameInfo, get the number of side pots |
int |
getNumWinners()
Get the number of players that were awarded a pot in this hand |
OurPlayerInfo |
getOurPlayer(int seat)
Get OurPlayerInfo from player in the given seat, to update his fields Use getPlayer if you just want to ask for the fields |
PlayerInfo |
getPlayer(int seat)
Get state information for a player in a given seat |
PlayerInfo |
getPlayer(java.lang.String name)
Get state information for a player with a given name |
java.lang.String |
getPlayerName(int seat)
Get the name of the player in a given seat |
PlayerInfoFieldsMessage[] |
getPlayers()
|
int |
getPlayerSeat(java.lang.String name)
Get the seat number for a player by name |
java.util.List<PlayerInfo> |
getPlayersInPot(double amount)
Get a list of all players eligible to win a pot with the given minimum stakes |
double |
getPot()
|
int |
getRaisesThisRound()
|
boolean |
getReverseBlinds()
|
int |
getSittingPlayers()
|
double |
getSmallBlind()
|
int |
getSmallBlindSeat()
from GameInfo, Get the amount raked from pot so far, not implemented |
int |
getSmallBlindSeatFromButton()
|
double |
getSmallBlindSize()
Get the amount of the small blind |
Stage |
getStage()
Get the current game stage |
double |
getStakes()
The stakes are the amount each player must have invested in the pot to stay active in the hand. |
double |
getTotalPotSize()
Get the total size of the pot including the main pot and all side pots. |
int |
getUnacted()
Get the number of players who have not acted yet this round |
int |
getWinners()
|
PokerGame.Blind |
hasToPostBlind(int seat)
Get whether the player has sat out some blinds, and has to pay any as a penalty for entering the game |
void |
increaseWinners()
increase the number of winners by one |
boolean |
inGame(int seat)
See if the player in the given seat is dealt into the hand (not sitting out or empty). |
boolean |
isActive(int seat)
See if the player in the given seat is still active in the hand |
boolean |
isCommitted(int seat)
See if a player has invested anything in the current round |
boolean |
isFixedLimit()
Determine if the game is fixed-limit |
boolean |
isNoLimit()
from GameInfo, See if the hand is over |
boolean |
isPotLimit()
from GameInfo, See if it is currently the post-flop |
boolean |
isReserved(int seat)
See if given seat is reserved |
boolean |
isReverseBlinds()
from GameInfo, See if it is currently the pre-flop |
boolean |
isSimulation()
from GameInfo, see if it is currently the river round |
boolean |
isZipMode()
from GameInfo, see if it is currently the turn round |
static void |
main(java.lang.String[] args)
|
double |
maxBuy()
return the maximum amount to bring to this table |
void |
maxPlayersToAct()
increase the number of Players to act to the maximum |
double |
minBuy()
return the minimum amount to bring to this table |
void |
moveBigBlindSeat()
use to move the big blind seat, when the player who should pay refuses |
void |
moveSmallBlindSeat()
use to move the big blind and small blind seats, when the player who should pay small blind refuses |
int |
nextActivePlayer(int seat)
Get the seat number of the next active player at the table (skips empty seats and folded players) |
int |
nextPlayer(int seat)
Get the seat number of the next active player at the table (skips empty seats and folded players) |
int |
nextSeat(int seat)
Get the seat number of the next seat clockwise at the table |
int |
previousPlayer(int seat)
Get the seat number of the previous player at the table (skips empty seats) |
boolean |
reserveSeat(int seat)
Sets the given seat to be reserved |
void |
setAnte(int ante)
set ante |
void |
setBigBlind(double bigBlind)
set the big blind |
void |
setBigBlindSeat(int seat)
Sets the big blind seat |
void |
setBoardCards(Hand boardCards)
Set the given hand as the board cards |
void |
setButtonSeat(int buttonSeat)
Set the button seat |
void |
setCurrentPlayerSeat(int currentPlayerSeat)
Set the current player |
void |
setGameID(long gameID)
set the game ID |
void |
setIsSimulation(boolean isSimulation)
set if the game is Simulation |
void |
setIsZipMode(boolean isZipMode)
set if the game is in zipMode |
void |
setLimitStyle(int limitStyle)
|
void |
setMinPlayers(int minPlayers)
set minPlayers |
void |
setMinRaise(double minRaise)
set minRaise |
void |
setNextActivePlayer()
|
void |
setNextPlayer()
|
void |
setPlayer(int seat,
OurPlayerInfo player)
Sets given players info to the given seat, is seat is taken, the previous player will be removed |
void |
setPlayer(int seat,
PlayerInfoFieldsMessage player)
Sets given players info to the given seat, is seat is taken, the previous player will be removed |
void |
setPlayers(PlayerInfoFieldsMessage[] players)
Removes all the players from the gameModel, and sets the given players infos in their stead |
void |
setPlayersToAct(int playersToAct)
set the number of players to act |
void |
setPot(double pot)
set the pot |
void |
setRaisesThisRound(int raisesThisRound)
set the number of raises this round |
void |
setReverseBlinds(boolean reverseBlinds)
set if the heads-up is in reverseblinds order, by default it is |
void |
setSmallBlind(double smallBlind)
set the small blind |
void |
setSmallBlindSeat(int seat)
Sets the small blind seat |
void |
setStage(Stage stage)
Set the stage |
void |
setStartPlayers(int maxPlayers)
|
Stage |
Stage()
|
void |
startHand()
removes history information from the players |
int |
update(GameModel newModel)
Little helper who changes this GameModel to have the same values as the given GameModel Saves that previous state of the model to the lastgameinfo of the previous currentplayer |
void |
zeroWinners()
set the number of winners to zero |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String NIL_OBJECT
public static final java.lang.String RESERVE_OBJECT
Constructor Detail |
---|
public GameModel(double smallBlind, double bigBlind, int minPlayers, int maxPlayers, long gameID, Stage stage)
stage
- stage of the gamesmallBlind
- small blind for the handbigBlind
- Big blind for the handminPlayers
- minimum amount of required playersmaxPlayers
- maximum players at the tablegameID
- ID for the first hand to be playedpublic GameModel(GameModelInfoMessage gmi)
Method Detail |
---|
public double minBuy()
minBuy
in interface GameInfo
public double maxBuy()
maxBuy
in interface GameInfo
public double getBiggestBet()
public void startHand()
public int getSmallBlindSeatFromButton()
public void setSmallBlindSeat(int seat)
seat
- public void setBigBlindSeat(int seat)
seat
- public void moveBigBlindSeat()
public void moveSmallBlindSeat()
public int getBigBlindSeatFromButton()
public boolean reserveSeat(int seat)
seat
-
public GameModelInfoMessage getGameModelInfo()
public int getMaxPlayers()
public void setLimitStyle(int limitStyle)
limitStyle
- set Fixed, Pot, or No Limitpublic int getLimitStyle()
public void setMinRaise(double minRaise)
minRaise
- public void setMinPlayers(int minPlayers)
minPlayers
- public int getMinPlayers()
public void setAnte(int ante)
ante
- public void freeSeat(int seat)
public void setPlayers(PlayerInfoFieldsMessage[] players)
players
- public void setPlayer(int seat, PlayerInfoFieldsMessage player)
seat
- player
- public void setStartPlayers(int maxPlayers)
public void setPlayer(int seat, OurPlayerInfo player)
seat
- player
- public PlayerInfoFieldsMessage[] getPlayers()
public void setButtonSeat(int buttonSeat)
buttonSeat
- public void setBigBlind(double bigBlind)
bigBlind
- public double getBigBlind()
public void setSmallBlind(double smallBlind)
smallBlind
- public double getSmallBlind()
public void setBoardCards(Hand boardCards)
boardCards
- public Hand getBoardCards()
public void addCardToBoard(Card card1)
card1
- public void setCurrentPlayerSeat(int currentPlayerSeat)
currentPlayerSeat
- public void setGameID(long gameID)
gameID
- public void setRaisesThisRound(int raisesThisRound)
raisesThisRound
- public int getRaisesThisRound()
public void addRaisesThisRound()
public void setPot(double pot)
pot
- public double getPot()
public void addToPot(double amount)
public void setStage(Stage stage)
stage
- public Stage Stage()
public void setIsSimulation(boolean isSimulation)
isSimulation
- public boolean getIsSimulation()
public void setIsZipMode(boolean isZipMode)
isZipMode
- public boolean getIsZipMode()
public void setReverseBlinds(boolean reverseBlinds)
reverseBlinds
- public boolean getReverseBlinds()
public OurPlayerInfo getOurPlayer(int seat)
seat
-
public void decreasePlayersToAct()
public void maxPlayersToAct()
public void setPlayersToAct(int playersToAct)
playersToAct
- public void increaseWinners()
public void zeroWinners()
public int getWinners()
public int update(GameModel newModel)
newModel
- GameModel to imitate
public static GameModel clone(GameModelInfoMessage previous)
previous
-
public static GameModel clone(GameModel previous)
public static GameModel cloneWithoutPreviousStates(GameModel previous)
public int getSittingPlayers()
public boolean canRaise(int seat)
GameInfo
canRaise
in interface GameInfo
seat
- position of the player
public double getAmountToCall(int seat)
GameInfo
getAmountToCall
in interface GameInfo
seat
- position of the player
public double getAnte()
GameInfo
getAnte
in interface GameInfo
public double getBankRoll(int seat)
GameInfo
getBankRoll
in interface GameInfo
seat
- position of the player
public double getBetsToCall(int seat)
getBetsToCall
in interface GameInfo
seat
- position of the player
InvalidSeatException,
- if the table does not have such a seat
EmptySeatException,
- if the given seat is empty
public double getBankRollAtRisk(int seat) {
if (seat<0 || seat>=this.getMaxPlayers())
throw new InvalidSeatException();
if (this.getPlayer(seat) == null)
throw new EmptySeatException();
return this.getPlayer(seat).getBankRollAtRisk();
}public int getBigBlindSeat()
GameInfo
getBigBlindSeat
in interface GameInfo
public double getBigBlindSize()
GameInfo
getBigBlindSize
in interface GameInfo
public Hand getBoard()
GameInfo
getBoard
in interface GameInfo
public int getButtonSeat()
GameInfo
getButtonSeat
in interface GameInfo
public double getCurrentBetSize()
GameInfo
getCurrentBetSize
in interface GameInfo
public int getCurrentPlayerSeat()
GameInfo
getCurrentPlayerSeat
in interface GameInfo
public double getEligiblePot(int seat)
GameInfo
getEligiblePot
in interface GameInfo
seat
- position of the player
public long getGameID()
GameInfo
getGameID
in interface GameInfo
public double getMainPotSize()
getMainPotSize
in interface GameInfo
public double getMinRaise()
GameInfo
getMinRaise
in interface GameInfo
public int getNumActivePlayers()
GameInfo
getNumActivePlayers
in interface GameInfo
public int getNumActivePlayersNotAllIn()
GameInfo
getNumActivePlayersNotAllIn
in interface GameInfo
public int getNumPlayers()
GameInfo
getNumPlayers
in interface GameInfo
public int getNumRaises()
GameInfo
getNumRaises
in interface GameInfo
public int getNumSeats()
GameInfo
getNumSeats
in interface GameInfo
public int getNumToAct()
getNumToAct
in interface GameInfo
public int getNumWinners()
GameInfo
getNumWinners
in interface GameInfo
public int getNumberOfAllInPlayers()
GameInfo
getNumberOfAllInPlayers
in interface GameInfo
public PlayerInfo getPlayer(int seat)
GameInfo
getPlayer
in interface GameInfo
seat
- position of the player
public PlayerInfo getPlayer(java.lang.String name)
GameInfo
getPlayer
in interface GameInfo
name
- the name of desired player
public java.lang.String getPlayerName(int seat)
GameInfo
getPlayerName
in interface GameInfo
seat
- position of the player
public int getPlayerSeat(java.lang.String name)
GameInfo
getPlayerSeat
in interface GameInfo
name
- the name of the player
public java.util.List<PlayerInfo> getPlayersInPot(double amount)
GameInfo
getPlayersInPot
in interface GameInfo
amount
- the amount a player must have in the pot to be eligible to win it
public int getSmallBlindSeat()
getSmallBlindSeat
in interface GameInfo
public double getSmallBlindSize()
GameInfo
getSmallBlindSize
in interface GameInfo
public Stage getStage()
GameInfo
getStage
in interface GameInfo
public double getStakes()
GameInfo
getStakes
in interface GameInfo
public double getTotalPotSize()
GameInfo
getTotalPotSize
in interface GameInfo
public int getUnacted()
GameInfo
getUnacted
in interface GameInfo
public boolean inGame(int seat)
GameInfo
inGame
in interface GameInfo
seat
- position of the player
public boolean isActive(int seat)
GameInfo
isActive
in interface GameInfo
seat
- position of the player
public boolean isCommitted(int seat)
GameInfo
isCommitted
in interface GameInfo
seat
- position of the player
public boolean isFixedLimit()
GameInfo
isFixedLimit
in interface GameInfo
public boolean isNoLimit()
isNoLimit
in interface GameInfo
public boolean isPotLimit()
isPotLimit
in interface GameInfo
public boolean isReverseBlinds()
isReverseBlinds
in interface GameInfo
public boolean isSimulation()
isSimulation
in interface GameInfo
public boolean isZipMode()
isZipMode
in interface GameInfo
public int nextActivePlayer(int seat)
GameInfo
nextActivePlayer
in interface GameInfo
seat
- position
public int nextPlayer(int seat)
GameInfo
nextPlayer
in interface GameInfo
seat
- position
public int nextSeat(int seat)
GameInfo
nextSeat
in interface GameInfo
seat
- position
public int previousPlayer(int seat)
GameInfo
previousPlayer
in interface GameInfo
seat
- position
public void setNextPlayer()
public void setNextActivePlayer()
public PlayerInfo getCurrentPlayer()
public int getCountablePlayers()
public void activatePlayer(int player)
public PokerGame.Blind hasToPostBlind(int seat)
GameInfo
hasToPostBlind
in interface GameInfo
seat
- of the player
public boolean isReserved(int seat)
GameInfo
isReserved
in interface GameInfo
public static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |