com.asdf.common
Class Action

java.lang.Object
  extended by com.asdf.common.Action

public class Action
extends java.lang.Object

Class representing the action that a Poker player might perform

Author:
rimpila

Field Summary
static int ALLIN_PASS
           
 double amount
           
static int BACK
           
static int BET
           
static int BIG_BLIND
           
static int CALL
           
static int CHECK
           
static int DISCARD
           
 int[] discarded
           
static int FOLD
           
 int index
           
static int INVALID
           
static int JOIN_GAME
           
static int LEAVE_GAME
           
static int MUCK
           
 java.lang.String name
           
static int POST_ANTE
           
static int POST_BLIND
           
static int POST_DEAD_BLIND
           
static int RAISE
           
static int RESERVE_SEAT
           
static int REVEAL
           
 int seat
           
static int SIT_OUT
           
static int SKIP_TURN
           
static int SMALL_BLIND
           
 
Constructor Summary
Action()
          Empty constructor
Action(int index)
          Constructor for the given action
Action(int index, double amount)
          Constructor for an action with the given index and amount
 
Method Summary
static Action allInPassAction()
           
static Action backAction()
           
static Action betAction(double amount2)
           
static Action bigBlindAction()
           
static Action callAction()
           
static Action checkAction()
           
static Action discardAction(int[] discarded)
           
 int discards()
           
 int discards(int i)
           
static Action foldAction()
           
 int getActionIndex()
          Getter for the index
 double getAmount()
          Getter for the amount
 boolean isAllInPass()
           
 boolean isBack()
           
 boolean isBet()
           
 boolean isBigBlind()
           
 boolean isCall()
           
 boolean isCheck()
           
 boolean isDiscard()
           
 boolean isFold()
           
 boolean isJoin()
           
 boolean isLeaveGame()
           
 boolean isMuck()
           
 boolean isPostAnte()
           
 boolean isPostBlind()
           
 boolean isPostDeadBlind()
           
 boolean isRaise()
           
 boolean isReserve()
           
 boolean isReveal()
           
 boolean isSitout()
           
 boolean isSkipTurn()
           
 boolean isSmallBlind()
           
static Action joinAction(java.lang.String name, int seat, double cash)
           
static Action leaveGameAction(int seat, double amount)
           
static Action muckAction()
           
 java.lang.String name()
          The name should be send with join game actions
static Action postAnte(double amount2)
           
static Action postBlindAction()
           
static Action postDeadBlindAction()
           
static Action raiseAction(double amount2)
           
static Action reserveAction(int seat)
           
static Action revealAction()
           
 int seat()
          Seat of the acting player, or the seat the player wishes to join
static Action sitout()
           
static Action sitOutAction()
           
static Action skipTurnAction()
           
static Action smallBlindAction()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CALL

public static final int CALL
See Also:
Constant Field Values

CHECK

public static final int CHECK
See Also:
Constant Field Values

RAISE

public static final int RAISE
See Also:
Constant Field Values

FOLD

public static final int FOLD
See Also:
Constant Field Values

ALLIN_PASS

public static final int ALLIN_PASS
See Also:
Constant Field Values

BET

public static final int BET
See Also:
Constant Field Values

BIG_BLIND

public static final int BIG_BLIND
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

POST_BLIND

public static final int POST_BLIND
See Also:
Constant Field Values

POST_DEAD_BLIND

public static final int POST_DEAD_BLIND
See Also:
Constant Field Values

SIT_OUT

public static final int SIT_OUT
See Also:
Constant Field Values

SMALL_BLIND

public static final int SMALL_BLIND
See Also:
Constant Field Values

INVALID

public static final int INVALID
See Also:
Constant Field Values

JOIN_GAME

public static final int JOIN_GAME
See Also:
Constant Field Values

RESERVE_SEAT

public static final int RESERVE_SEAT
See Also:
Constant Field Values

LEAVE_GAME

public static final int LEAVE_GAME
See Also:
Constant Field Values

REVEAL

public static final int REVEAL
See Also:
Constant Field Values

DISCARD

public static final int DISCARD
See Also:
Constant Field Values

BACK

public static final int BACK
See Also:
Constant Field Values

SKIP_TURN

public static final int SKIP_TURN
See Also:
Constant Field Values

index

public int index

amount

public double amount

discarded

public int[] discarded

name

public java.lang.String name

seat

public int seat
Constructor Detail

Action

public Action()
Empty constructor


Action

public Action(int index,
              double amount)
Constructor for an action with the given index and amount

Parameters:
index -
amount -

Action

public Action(int index)
Constructor for the given action

Parameters:
index -
Method Detail

getActionIndex

public int getActionIndex()
Getter for the index

Returns:
integer corresponding to the action

getAmount

public double getAmount()
Getter for the amount

Returns:
amount

isCall

public boolean isCall()
Returns:
true if the action is call, false otherwise

isCheck

public boolean isCheck()
Returns:
true if the action is check, false otherwise

isRaise

public boolean isRaise()
Returns:
true if the action is raise, false otherwise

isFold

public boolean isFold()
Returns:
true if the action is fold, false otherwise

isAllInPass

public boolean isAllInPass()
Returns:
true if the action is all in pass, false otherwise

isBet

public boolean isBet()
Returns:
true if the action is bet, false otherwise

isBigBlind

public boolean isBigBlind()
Returns:
true if the action is posting big blind, false otherwise

isMuck

public boolean isMuck()
Returns:
true if the action is muck, false otherwise

isPostAnte

public boolean isPostAnte()
Returns:
true if the action is posting ante, false otherwise

isPostBlind

public boolean isPostBlind()
Returns:
true if the action is posting a blind, false otherwise

isPostDeadBlind

public boolean isPostDeadBlind()
Returns:
true if the action is posting a dead blind, false otherwise

isSitout

public boolean isSitout()
Returns:
true if the action is sitting out, false otherwise

isSmallBlind

public boolean isSmallBlind()
Returns:
true if the action is posting small blind, false otherwise

isJoin

public boolean isJoin()
Returns:
true if the action is join game, false otherwise

name

public java.lang.String name()
The name should be send with join game actions

Returns:
the name for this action

seat

public int seat()
Seat of the acting player, or the seat the player wishes to join

Returns:
seat

checkAction

public static Action checkAction()
Returns:
a check action

foldAction

public static Action foldAction()
Returns:
a fold action

allInPassAction

public static Action allInPassAction()
Returns:
an all in pass action

callAction

public static Action callAction()
Returns:
a call action

betAction

public static Action betAction(double amount2)
Parameters:
amount2 - amount to bet
Returns:
a bet action

postAnte

public static Action postAnte(double amount2)
Parameters:
amount2 - amount to ante
Returns:
a post ante action

bigBlindAction

public static Action bigBlindAction()
Returns:
a big blind action

muckAction

public static Action muckAction()
Returns:
a muck action

postDeadBlindAction

public static Action postDeadBlindAction()
Returns:
a post dead blind action

postBlindAction

public static Action postBlindAction()
Returns:
a post blind action

sitOutAction

public static Action sitOutAction()
Returns:
a sit out action

sitout

public static Action sitout()
Returns:
a sit out action

raiseAction

public static Action raiseAction(double amount2)
Parameters:
amount2 - amount to raise
Returns:
a raise action with the given amount

smallBlindAction

public static Action smallBlindAction()
Returns:
a small blind action

joinAction

public static Action joinAction(java.lang.String name,
                                int seat,
                                double cash)
Parameters:
name - with which the player wishes to play
seat - at which the player wishes to sit
cash - the amount to bring to the table
Returns:
a join action

reserveAction

public static Action reserveAction(int seat)
Parameters:
seat - to reserve
Returns:
a reserve action

leaveGameAction

public static Action leaveGameAction(int seat,
                                     double amount)
Parameters:
seat - from which to leave
amount - value should be < -1 if the player wishes to also be removed from the watcher list (i.e. closing the GUI)
Returns:
a leave game action

discardAction

public static Action discardAction(int[] discarded)
Parameters:
discarded - positions of discarded cards
Returns:
discard action

isReserve

public boolean isReserve()
Returns:
true if the action is reserve, false otherwise

isLeaveGame

public boolean isLeaveGame()
Returns:
true if the action is leave game, false otherwise

revealAction

public static Action revealAction()
Returns:
reveal action

isReveal

public boolean isReveal()
Returns:
true if the action is reveal, false otherwise

isDiscard

public boolean isDiscard()
Returns:
true if the action is discard, false otherwise

discards

public int discards()
Returns:
number of discarded cards

discards

public int discards(int i)
Parameters:
i -
Returns:
position of discarded card number i

backAction

public static Action backAction()
Returns:
a back action from sit out

isBack

public boolean isBack()
Returns:
true if the action is back, false otherwise

skipTurnAction

public static Action skipTurnAction()
Returns:
a skip turn action

isSkipTurn

public boolean isSkipTurn()
Returns:
true if action is skip turn