poker
Class Action

java.lang.Object
  extended by poker.Action

public class Action
extends java.lang.Object

An action by a player in a poker game

Author:
Aaron Davidson

Field Summary
static int ALLIN_PASS
           
static int BET
           
static int BIG_BLIND
           
static int CALL
           
static int CHECK
           
static int FOLD
           
static int INVALID
           
static int MUCK
           
static int POST_ANTE
           
static int POST_BLIND
           
static int RAISE
           
static int SMALL_BLIND
           
 
Constructor Summary
Action(int type, double toCall, double amount)
           
 
Method Summary
static Action actionFilter(Action a, int seat, Card c1, Card c2, GameInfo gi)
          Do some basic checks to change the action if game conditions warrant it.
static Action allInPassAction()
           
static Action betAction(double amountToRaise)
           
static Action bigBlindAction(double toPost)
           
static Action callAction(double toCall)
           
static Action checkAction()
           
static Action checkOrFoldAction(double toCall)
           
 boolean equivalent(Action a)
           
static Action foldAction(double toCall)
           
static java.lang.String formatCash(double value)
           
static java.lang.String formatCashFull(double value)
           
static Action getAction(int a, double toCall, double amount)
          Create an action from classic values.
 int getActionIndex()
          Convert an update action to a general action {fold,call,raise} or -1 if not a normal voluntary action.
 double getAmount()
           
 double getToCall()
           
 int getType()
           
 boolean isAllInPass()
           
 boolean isAnte()
           
 boolean isBet()
           
 boolean isBetOrRaise()
           
 boolean isBigBlind()
           
 boolean isBlind()
           
 boolean isCall()
           
 boolean isCheck()
           
 boolean isCheckOrCall()
           
 boolean isFold()
           
 boolean isFoldOrMuck()
           
 boolean isMuck()
           
 boolean isRaise()
           
 boolean isSmallBlind()
           
 boolean isVoluntary()
           
static Action muckAction()
           
static Action postAnte(double toPost)
           
static Action postBlindAction(double toPost)
           
static Action raiseAction(double toCall, double amountToRaise)
           
static Action smallBlindAction(double toPost)
           
 java.lang.String toString()
          Interprets an action event into a string describing the action.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

INVALID

public static final int INVALID
See Also:
Constant Field Values

FOLD

public static final int FOLD
See Also:
Constant Field Values

CHECK

public static final int CHECK
See Also:
Constant Field Values

CALL

public static final int CALL
See Also:
Constant Field Values

BET

public static final int BET
See Also:
Constant Field Values

RAISE

public static final int RAISE
See Also:
Constant Field Values

SMALL_BLIND

public static final int SMALL_BLIND
See Also:
Constant Field Values

BIG_BLIND

public static final int BIG_BLIND
See Also:
Constant Field Values

POST_BLIND

public static final int POST_BLIND
See Also:
Constant Field Values

ALLIN_PASS

public static final int ALLIN_PASS
See Also:
Constant Field Values

MUCK

public static final int MUCK
See Also:
Constant Field Values

POST_ANTE

public static final int POST_ANTE
See Also:
Constant Field Values
Constructor Detail

Action

public Action(int type,
              double toCall,
              double amount)
Method Detail

equivalent

public boolean equivalent(Action a)

getAmount

public double getAmount()

getToCall

public double getToCall()

getType

public int getType()

postAnte

public static Action postAnte(double toPost)

postBlindAction

public static Action postBlindAction(double toPost)

smallBlindAction

public static Action smallBlindAction(double toPost)

bigBlindAction

public static Action bigBlindAction(double toPost)

foldAction

public static Action foldAction(double toCall)

checkOrFoldAction

public static Action checkOrFoldAction(double toCall)

muckAction

public static Action muckAction()

checkAction

public static Action checkAction()

callAction

public static Action callAction(double toCall)

betAction

public static Action betAction(double amountToRaise)

raiseAction

public static Action raiseAction(double toCall,
                                 double amountToRaise)

allInPassAction

public static Action allInPassAction()

isFold

public boolean isFold()

isFoldOrMuck

public boolean isFoldOrMuck()

isCheck

public boolean isCheck()

isCall

public boolean isCall()

isCheckOrCall

public boolean isCheckOrCall()

isBet

public boolean isBet()

isRaise

public boolean isRaise()

isBetOrRaise

public boolean isBetOrRaise()

isBlind

public boolean isBlind()

isSmallBlind

public boolean isSmallBlind()

isBigBlind

public boolean isBigBlind()

isAllInPass

public boolean isAllInPass()

isMuck

public boolean isMuck()

isAnte

public boolean isAnte()

getActionIndex

public int getActionIndex()
Convert an update action to a general action {fold,call,raise} or -1 if not a normal voluntary action.


actionFilter

public static Action actionFilter(Action a,
                                  int seat,
                                  Card c1,
                                  Card c2,
                                  GameInfo gi)
Do some basic checks to change the action if game conditions warrant it. Folds will be changed to checks, and only the nuts will be raised past the normal cap.


getAction

public static Action getAction(int a,
                               double toCall,
                               double amount)
Create an action from classic values.

Parameters:
a - Holdem.FOLD, Holdem.CALL, or Holdem.RAISE
toCall - amount to call
amount - amount to raise, or 0

toString

public java.lang.String toString()
Interprets an action event into a string describing the action.

Overrides:
toString in class java.lang.Object
Parameters:
pos - the player that acted
action - the action code
Returns:
a string representing the action

formatCash

public static java.lang.String formatCash(double value)

formatCashFull

public static java.lang.String formatCashFull(double value)

isVoluntary

public boolean isVoluntary()