com.asdf.plugins.pokergames
Class PlayerStates

java.lang.Object
  extended by com.asdf.plugins.pokergames.PlayerStates

public class PlayerStates
extends java.lang.Object

Efficient bit scrabble implementation for a Player state. Mostly checking n:th bit from state variable. No comments necessary for methods.


Constructor Summary
PlayerStates()
           
 
Method Summary
static int activated(int state)
          Set the state to reflect that the player is in game, and active and not folded, nor sitting out
static int committed(int state)
          Set the state to reflect that the player has committed
static int folded(int state)
          Set the state to reflect that the player has folded, and is not active
static int inGame(int state)
          Set the state to reflect that the player is in game
static boolean isActive(int state)
          Checks if the player's state says he is active.
static boolean isCommitted(int state)
          Checks if the player's state says he has committed funds.
static boolean isFolded(int state)
          Checks if the player's state says he is folded.
static boolean isInGame(int state)
          Checks if the player's state says he is in game.
static boolean isSittingOut(int state)
          Checks if the player's state says he is sitting out.
static void main(java.lang.String[] args)
          ugly tests.
static int sitIn(int state)
          Set the state to reflect that the player is in game
static int sitOut(int state)
          Set the state to reflect that the player is sitting out
static int unCommitted(int state)
          Set the state to reflect that the player not committed
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PlayerStates

public PlayerStates()
Method Detail

isInGame

public static boolean isInGame(int state)
Checks if the player's state says he is in game.

Parameters:
state - Integer representation of a player's state.
Returns:
true if the player is in game, false otherwise.

inGame

public static int inGame(int state)
Set the state to reflect that the player is in game

Parameters:
state - Integer representation of a player's state.
Returns:
state so that isInGame is true

isActive

public static boolean isActive(int state)
Checks if the player's state says he is active.

Parameters:
state - Integer representation of a player's state.
Returns:
true if the player is active, false otherwise.

isFolded

public static boolean isFolded(int state)
Checks if the player's state says he is folded.

Parameters:
state - Integer representation of a player's state.
Returns:
true if the player has folded, false otherwise.

folded

public static int folded(int state)
Set the state to reflect that the player has folded, and is not active

Parameters:
state - Integer representation of a player's state.
Returns:
state

activated

public static int activated(int state)
Set the state to reflect that the player is in game, and active and not folded, nor sitting out

Parameters:
state - Integer representation of a player's state.
Returns:
state

isCommitted

public static boolean isCommitted(int state)
Checks if the player's state says he has committed funds.

Parameters:
state - Integer representation of a player's state.
Returns:
true if the player has committed, false otherwise.

committed

public static int committed(int state)
Set the state to reflect that the player has committed

Parameters:
state - Integer representation of a player's state.
Returns:
state

unCommitted

public static int unCommitted(int state)
Set the state to reflect that the player not committed

Parameters:
state - Integer representation of a player's state.
Returns:
state

isSittingOut

public static boolean isSittingOut(int state)
Checks if the player's state says he is sitting out.

Parameters:
state - Integer representation of a player's state.
Returns:
true if the player is sitting out, false otherwise.

sitOut

public static int sitOut(int state)
Set the state to reflect that the player is sitting out

Parameters:
state - Integer representation of a player's state.
Returns:
state

sitIn

public static int sitIn(int state)
Set the state to reflect that the player is in game

Parameters:
state - Integer representation of a player's state.
Returns:
state

main

public static void main(java.lang.String[] args)
ugly tests. Don't read this, it is meaningless.

Parameters:
args - ...