com.asdf.plugins.pokergames
Class OurPlayerInfo

java.lang.Object
  extended by com.asdf.plugins.pokergames.OurPlayerInfo
All Implemented Interfaces:
PlayerInfo

public class OurPlayerInfo
extends java.lang.Object
implements PlayerInfo

Our implementation for PlayerInfo

Author:
rimpila

Constructor Summary
OurPlayerInfo(GameInfo gameInfo, PlayerInfoFieldsMessage info)
           
OurPlayerInfo(OurPlayerInfo previous)
          for cloning players for deep copies
OurPlayerInfo(java.lang.String name, java.lang.String AccountName, double bankRoll, int mySeat, GameInfo gameInfo2)
           
 
Method Summary
 void decreaseBankRoll(double amount)
           
 GameInfo gameInfo()
           
 java.lang.String getAccountName()
          Returns the account name of this player.
 double getAmountCallable()
          Get the amount of the current bet that the player can call
 double getAmountInPot()
          Obtain the amount the player has invested in the pot.
 double getAmountInPotThisRound()
          Obtain the amount the player has invested in the pot this round
 double getAmountRaiseable()
          Get the maximum amount the player can raise.
 double getAmountToCall()
          Determine the amount a player must pay to stay in the game
 double getBankRoll()
          Get the current bankroll
 double getBankRollAtStartOfHand()
          Get the player's bankroll at the start of the hand (i.e., before any actions including antes and blinds).
 double getBankRollInSmallBets()
          Get the current bankroll as a multiple of the big blind
 GameInfo getGameInfo()
          Get the context of the last action made by this player.
 boolean getHasActedThisRound()
           
 Hand getHoleCards()
           
 PlayerInfoFieldsMessage getInfoFields()
           
 double getInPot()
           
 double getInPotThisRound()
           
 int getLastAction()
          A single integer code for the last action made
 java.lang.String getName()
          Obtain the player's name
 double getNetGain()
          Get the net amount won or lost since the start of the current hand
 double getRaiseAmount(double amountToRaise)
          Return the amount the player can raise, given the desired amount to raise.
 Hand getRevealedHand()
          Obtain the hand revealed by this player
 int getSeat()
          Get the player's seat number in the GameInfo
 int getState()
           
 boolean hasActedThisRound()
          Check if a player has made at least one action this round
 boolean hasEnoughToRaise()
          Check if the player has enough chips to complete a raise
 PokerGame.Blind hasToPostBlind()
          Get whether the player has sat out some blinds, and has to pay any as a penalty for entering the game
 void increaseBankRoll(double amount)
           
 void increaseInPot(double amount)
           
 void increaseInPotThisRound(double amount)
           
 boolean inGame()
          See if the player is dealt into the current game
 boolean isActive()
          Check if the player is still active in the hand
 boolean isAllIn()
          Check if the player is all-in
 boolean isButton()
          Check if the player is all-in
 boolean isCommitted()
          Check if the player has voluntarily committed this round
 boolean isFolded()
          Check if the player has folded
 boolean isSittingOut()
          Check if the player is sitting out
static void main(java.lang.String[] args)
           
 void setAccountName(java.lang.String accountName)
           
 void setBankRoll(double bankRoll)
           
 void setBankRollAtStartOfHand(double bankRollAtStartOfHand)
           
 void setGameInfo(GameInfo gameInfo)
           
 void setHasActedThisRound(boolean hasActedThisRound)
           
 void setHasToPostBlind(PokerGame.Blind amount)
           
 void setHoleCards(Hand holeCards)
           
 void setInPot(double inPot)
           
 void setInPotThisRound(double inPotThisRound)
           
 void setLastAction(int lastAction)
           
 void setLastGameInfo(GameModel info)
           
 void setLastGameInfo(GameModelInfoMessage info)
           
 void setName(java.lang.String myName)
           
 void setSeat(int seat)
           
 void setState(int state)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OurPlayerInfo

public OurPlayerInfo(java.lang.String name,
                     java.lang.String AccountName,
                     double bankRoll,
                     int mySeat,
                     GameInfo gameInfo2)

OurPlayerInfo

public OurPlayerInfo(GameInfo gameInfo,
                     PlayerInfoFieldsMessage info)

OurPlayerInfo

public OurPlayerInfo(OurPlayerInfo previous)
for cloning players for deep copies

Parameters:
previous -
Method Detail

getInfoFields

public PlayerInfoFieldsMessage getInfoFields()

setGameInfo

public void setGameInfo(GameInfo gameInfo)

gameInfo

public GameInfo gameInfo()

setLastGameInfo

public void setLastGameInfo(GameModelInfoMessage info)

setLastGameInfo

public void setLastGameInfo(GameModel info)

setAccountName

public void setAccountName(java.lang.String accountName)

setName

public void setName(java.lang.String myName)

setSeat

public void setSeat(int seat)

setState

public void setState(int state)

getState

public int getState()

setBankRoll

public void setBankRoll(double bankRoll)

increaseBankRoll

public void increaseBankRoll(double amount)

decreaseBankRoll

public void decreaseBankRoll(double amount)

setInPot

public void setInPot(double inPot)

increaseInPot

public void increaseInPot(double amount)

getInPot

public double getInPot()

setBankRollAtStartOfHand

public void setBankRollAtStartOfHand(double bankRollAtStartOfHand)

setInPotThisRound

public void setInPotThisRound(double inPotThisRound)

increaseInPotThisRound

public void increaseInPotThisRound(double amount)

getInPotThisRound

public double getInPotThisRound()

setHoleCards

public void setHoleCards(Hand holeCards)

getHoleCards

public Hand getHoleCards()

setLastAction

public void setLastAction(int lastAction)

setHasActedThisRound

public void setHasActedThisRound(boolean hasActedThisRound)

getHasActedThisRound

public boolean getHasActedThisRound()

hasToPostBlind

public PokerGame.Blind hasToPostBlind()
Description copied from interface: PlayerInfo
Get whether the player has sat out some blinds, and has to pay any as a penalty for entering the game

Specified by:
hasToPostBlind in interface PlayerInfo
Returns:
missed blinds

setHasToPostBlind

public void setHasToPostBlind(PokerGame.Blind amount)

getAccountName

public java.lang.String getAccountName()
Returns the account name of this player.

Specified by:
getAccountName in interface PlayerInfo
Returns:
Account name.

getAmountCallable

public double getAmountCallable()
Description copied from interface: PlayerInfo
Get the amount of the current bet that the player can call

Specified by:
getAmountCallable in interface PlayerInfo
Returns:
how much the player can pay of the amount he should call

getAmountInPot

public double getAmountInPot()
Description copied from interface: PlayerInfo
Obtain the amount the player has invested in the pot.

Specified by:
getAmountInPot in interface PlayerInfo
Returns:
the amount the player has in the pot of the current hand

getAmountInPotThisRound

public double getAmountInPotThisRound()
Description copied from interface: PlayerInfo
Obtain the amount the player has invested in the pot this round

Specified by:
getAmountInPotThisRound in interface PlayerInfo
Returns:
the amount the player has invested in the pot this round

getAmountRaiseable

public double getAmountRaiseable()
Description copied from interface: PlayerInfo
Get the maximum amount the player can raise.

Specified by:
getAmountRaiseable in interface PlayerInfo
Returns:
the amount the player will be able to raise, thus, either the upper limit for raises, or the total bankroll

getAmountToCall

public double getAmountToCall()
Description copied from interface: PlayerInfo
Determine the amount a player must pay to stay in the game

Specified by:
getAmountToCall in interface PlayerInfo
Returns:
the difference between the player who has bet most in the pot, and this players amount in the pot

getBankRoll

public double getBankRoll()
Description copied from interface: PlayerInfo
Get the current bankroll

Specified by:
getBankRoll in interface PlayerInfo
Returns:
the amount of money the player has in his disposal in the table

getBankRollAtStartOfHand

public double getBankRollAtStartOfHand()
Description copied from interface: PlayerInfo
Get the player's bankroll at the start of the hand (i.e., before any actions including antes and blinds).

Specified by:
getBankRollAtStartOfHand in interface PlayerInfo
Returns:
the amount the player had in his bankroll before any antes, blinds or bets

getBankRollInSmallBets

public double getBankRollInSmallBets()
Description copied from interface: PlayerInfo
Get the current bankroll as a multiple of the big blind

Specified by:
getBankRollInSmallBets in interface PlayerInfo
Returns:
the players bankroll divided by the size of the big blind

getGameInfo

public GameInfo getGameInfo()
Description copied from interface: PlayerInfo
Get the context of the last action made by this player.

Specified by:
getGameInfo in interface PlayerInfo
Returns:
the GameInfo saved when doing latest action

getLastAction

public int getLastAction()
Description copied from interface: PlayerInfo
A single integer code for the last action made

Specified by:
getLastAction in interface PlayerInfo
Returns:
one of [Holdem.FOLD, Holdem.CALL, Holdem.RAISE]

getName

public java.lang.String getName()
Description copied from interface: PlayerInfo
Obtain the player's name

Specified by:
getName in interface PlayerInfo
Returns:
the name of the player

getNetGain

public double getNetGain()
Description copied from interface: PlayerInfo
Get the net amount won or lost since the start of the current hand

Specified by:
getNetGain in interface PlayerInfo
Returns:
the difference between current bankroll and the bankroll at the start of hand

getRaiseAmount

public double getRaiseAmount(double amountToRaise)
Description copied from interface: PlayerInfo
Return the amount the player can raise, given the desired amount to raise.

Specified by:
getRaiseAmount in interface PlayerInfo
Parameters:
amountToRaise - the amount desired to raise
Returns:
the amount player is able to raise given the desired

getRevealedHand

public Hand getRevealedHand()
Description copied from interface: PlayerInfo
Obtain the hand revealed by this player

Specified by:
getRevealedHand in interface PlayerInfo
Returns:
the players hole cards, if he has revealed them, otherwise 2 invalid cards, if he has two, otherwise empty hand

getSeat

public int getSeat()
Description copied from interface: PlayerInfo
Get the player's seat number in the GameInfo

Specified by:
getSeat in interface PlayerInfo
Returns:
the players seat number

hasActedThisRound

public boolean hasActedThisRound()
Description copied from interface: PlayerInfo
Check if a player has made at least one action this round

Specified by:
hasActedThisRound in interface PlayerInfo
Returns:
true if the player has acted this round

hasEnoughToRaise

public boolean hasEnoughToRaise()
Description copied from interface: PlayerInfo
Check if the player has enough chips to complete a raise

Specified by:
hasEnoughToRaise in interface PlayerInfo
Returns:
true if the player has enough for minimum raise after paying what he has to call

inGame

public boolean inGame()
Description copied from interface: PlayerInfo
See if the player is dealt into the current game

Specified by:
inGame in interface PlayerInfo
Returns:
true if the player is dealt in

isActive

public boolean isActive()
Description copied from interface: PlayerInfo
Check if the player is still active in the hand

Specified by:
isActive in interface PlayerInfo
Returns:
true if the player is active in current hand

isAllIn

public boolean isAllIn()
Description copied from interface: PlayerInfo
Check if the player is all-in

Specified by:
isAllIn in interface PlayerInfo
Returns:
true if the player is all-in

isButton

public boolean isButton()
Description copied from interface: PlayerInfo
Check if the player is all-in

Specified by:
isButton in interface PlayerInfo
Returns:
true if the player is all-in

isCommitted

public boolean isCommitted()
Description copied from interface: PlayerInfo
Check if the player has voluntarily committed this round

Specified by:
isCommitted in interface PlayerInfo
Returns:
true if the player has committed

isFolded

public boolean isFolded()
Description copied from interface: PlayerInfo
Check if the player has folded

Specified by:
isFolded in interface PlayerInfo
Returns:
true if the player has folded

isSittingOut

public boolean isSittingOut()
Description copied from interface: PlayerInfo
Check if the player is sitting out

Specified by:
isSittingOut in interface PlayerInfo
Returns:
true if the player is sitting out

main

public static void main(java.lang.String[] args)