glassfrog.players
Class StringPlayer

java.lang.Object
  extended by glassfrog.players.Player
      extended by glassfrog.players.StringPlayer
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<Player>

public class StringPlayer
extends Player

A Player used for testing purposes that takes an action string "|" delimited and will play those actions until the string has run out, then it will play the default action of call

Author:
jdavidso
See Also:
Serialized Form

Field Summary
private  java.lang.String action
           
private  java.lang.String actionString
           
private  java.util.StringTokenizer actionTok
           
private  boolean repeatAction
           
 
Constructor Summary
StringPlayer(java.lang.String name, int buyIn, int seat, java.lang.String actionString)
          Constructor for a StringPlayer.
 
Method Summary
 java.lang.String getAction()
          Returns the next action in the string given by the tokenizer, default action c
 void shutdown()
          Do nothing
 java.lang.String toString()
          Appends String to the @Player toString method
 void update(java.lang.String gamestate)
          Do nothing
 
Methods inherited from class glassfrog.players.Player
addToScore, bet, call, compareTo, fold, getBuyIn, getCardString, getCurrentBet, getHandRank, getHandString, getName, getPosition, getScore, getSeat, getStack, getTotalCommitedToPot, initTimeout, isAAAIPlayer, isActed, isAllIn, isFolded, isGuiPlayer, isSocketPlayer, payout, postBlind, resetHand, resetPlayer, resetRound, resetStack, setBuyIn, setCardString, setHandRank, setHandString, setName, setPosition, setScore, setSeat, setStack, subtractTotalCommitedToPot, toShortString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

actionString

private transient java.lang.String actionString

actionTok

private transient java.util.StringTokenizer actionTok

repeatAction

private transient boolean repeatAction

action

private transient java.lang.String action
Constructor Detail

StringPlayer

public StringPlayer(java.lang.String name,
                    int buyIn,
                    int seat,
                    java.lang.String actionString)
Constructor for a StringPlayer. The constructor takes a name, a buyIn amount a seat and an actionString. The action string is a series of actions that the player will take delimited by "|" . A special case of this is the single character string, which can be used to creat an "always X" player where X is one of {f,c,r, rN}. Once a player runs out of actions and if it is on the special case, action c will be returned

Parameters:
name - String representing the player name
buyIn - int representing the buyIn amount
seat - int representing the seat the player is in.
actionString - A "|" delimited string that represents players action
Method Detail

getAction

public java.lang.String getAction()
Returns the next action in the string given by the tokenizer, default action c

Specified by:
getAction in class Player
Returns:
The next action for the player to take

update

public void update(java.lang.String gamestate)
Do nothing

Specified by:
update in class Player
Parameters:
gamestate - a String reprenting the gamestate

shutdown

public void shutdown()
Do nothing

Specified by:
shutdown in class Player

toString

public java.lang.String toString()
Appends String to the @Player toString method

Overrides:
toString in class Player
Returns:
"String" appended to the toString method of @Player