com.anji.roshambo
Class OneTrackMindPlayer

java.lang.Object
  extended by com.anji.roshambo.OneTrackMindPlayer
All Implemented Interfaces:
RoshamboPlayer, IteratedPlayer, Player, Configurable

public class OneTrackMindPlayer
extends java.lang.Object
implements RoshamboPlayer, Configurable

Author:
Philip Tucker

Field Summary
 
Fields inherited from interface com.anji.roshambo.RoshamboPlayer
DRAW, LOSS, PAPER, ROCK, SCISSORS, WIN
 
Constructor Summary
OneTrackMindPlayer()
          default ctor
OneTrackMindPlayer(boolean aRandStart)
           
OneTrackMindPlayer(int aTrack)
           
 
Method Summary
 java.lang.String getAuthor()
           
 int getOneTrack()
           
 java.lang.String getPlayerId()
           
 int hashCode()
           
 void init(Properties props)
           
 int nextMove()
          Produce your next move.
 void reset()
          reset player state; after a call to reset, the player should be in the same state as it was when created; i.e., it has no memory of previous games played
 void reset(int trials)
          Initialize a new match against an unknown opponent.
 void storeMove(int move, int score)
          Store the opponent's choice and the outcome of the latest move.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OneTrackMindPlayer

public OneTrackMindPlayer()
default ctor


OneTrackMindPlayer

public OneTrackMindPlayer(int aTrack)
Parameters:
aTrack -

OneTrackMindPlayer

public OneTrackMindPlayer(boolean aRandStart)
Parameters:
aRandStart -
Method Detail

reset

public void reset()
Description copied from interface: Player
reset player state; after a call to reset, the player should be in the same state as it was when created; i.e., it has no memory of previous games played

Specified by:
reset in interface Player
See Also:
Player.reset()

reset

public void reset(int trials)
Description copied from interface: RoshamboPlayer
Initialize a new match against an unknown opponent. The length of the match is specified in the paramater "trials". This function is always called before any match is played.

Specified by:
reset in interface RoshamboPlayer
Specified by:
reset in interface IteratedPlayer
Parameters:
trials - number of iterations for current game; player will be reset again before playing another game
See Also:
RoshamboPlayer.reset(int)

storeMove

public void storeMove(int move,
                      int score)
Description copied from interface: RoshamboPlayer
Store the opponent's choice and the outcome of the latest move. This function is called after every move. move is one of ROCK, PAPER, SCISSORS. score is one of DRAW, WIN, LOSS.

Specified by:
storeMove in interface RoshamboPlayer
See Also:
RoshamboPlayer.storeMove(int, int)

nextMove

public int nextMove()
Description copied from interface: RoshamboPlayer
Produce your next move.

Specified by:
nextMove in interface RoshamboPlayer
Returns:
one of ROCK, PAPER, SISSORS
See Also:
RoshamboPlayer.nextMove()

getPlayerId

public java.lang.String getPlayerId()
Specified by:
getPlayerId in interface RoshamboPlayer
Specified by:
getPlayerId in interface Player
Returns:
the name (and version) of this subject.
See Also:
Player.getPlayerId()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
See Also:
Object.toString()

getAuthor

public java.lang.String getAuthor()
Specified by:
getAuthor in interface RoshamboPlayer
Returns:
the author's name of this subject.
See Also:
RoshamboPlayer.getAuthor()

init

public void init(Properties props)
          throws java.lang.Exception
Specified by:
init in interface Configurable
Parameters:
props - configuration parameters
Throws:
java.lang.Exception
See Also:
Configurable.init(Properties)

getOneTrack

public int getOneTrack()
Returns:
ROCK,SCISSORS, or PAPER

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object
See Also:
Object.hashCode()