com.anji.roshambo
Class RoshamboGame

java.lang.Object
  extended bycom.anji.roshambo.RoshamboGame
All Implemented Interfaces:
Configurable, Game

public class RoshamboGame
extends java.lang.Object
implements Game, Configurable

http://www.cs.unimaas.nl/~donkers/games/roshambo03/ Modified by Philip Tucker to implement Game interface. Renamed from RoshamboGame.


Constructor Summary
RoshamboGame()
          ctor - should call init(Properties) after this ctor
RoshamboGame(GameConfiguration aConfig)
           
RoshamboGame(java.lang.String player1, java.lang.String player2)
           
 
Method Summary
 java.lang.String describe()
           
 java.lang.String getError()
           
 int getMaxScore(ScoringWeights aWeights)
           
 int getMinScore(ScoringWeights aWeights)
           
 void init(Properties props)
           
 boolean isLoaded()
           
static void main(java.lang.String[] args)
           
 int match(int trials)
           
 GameResults play(PlayerResults playerOneResults, PlayerResults playerTwoResults)
           
 java.lang.Class requiredPlayerClass()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RoshamboGame

public RoshamboGame()
ctor - should call init(Properties) after this ctor


RoshamboGame

public RoshamboGame(GameConfiguration aConfig)
Parameters:
aConfig -

RoshamboGame

public RoshamboGame(java.lang.String player1,
                    java.lang.String player2)
Parameters:
player1 -
player2 -
Method Detail

play

public GameResults play(PlayerResults playerOneResults,
                        PlayerResults playerTwoResults)
Specified by:
play in interface Game
Parameters:
playerOneResults -
playerTwoResults -
Returns:
GameResults for this game only; these totals are also added to each players results
See Also:
Game.play(com.anji.tournament.PlayerResults, com.anji.tournament.PlayerResults)

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Parameters:
args -
Throws:
java.lang.Exception

describe

public java.lang.String describe()
Returns:
description

match

public int match(int trials)
Parameters:
trials -
Returns:
subject one score

isLoaded

public boolean isLoaded()
Returns:
true if players loaded

getError

public java.lang.String getError()
Returns:
error string

requiredPlayerClass

public java.lang.Class requiredPlayerClass()
Specified by:
requiredPlayerClass in interface Game
Returns:
class of which all players must be subclass (or implementor, if interface); must be implementor of Player
See Also:
Game.requiredPlayerClass()

toString

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

getMaxScore

public int getMaxScore(ScoringWeights aWeights)
Specified by:
getMaxScore in interface Game
Parameters:
aWeights -
Returns:
maximum possible score for a single game, given these scoring weights
See Also:
Game.getMaxScore(com.anji.tournament.ScoringWeights)

getMinScore

public int getMinScore(ScoringWeights aWeights)
Specified by:
getMinScore in interface Game
Parameters:
aWeights -
Returns:
minimum possible score for a single game game, given these scoring weights
See Also:
Game.getMinScore(com.anji.tournament.ScoringWeights)

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(com.anji.util.Properties)