com.anji.roshambo
Class RoshamboGame
java.lang.Object
com.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.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
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
-
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)