com.anji.tournament
Class DirectTournament
java.lang.Object
com.anji.tournament.SimpleTournament
com.anji.tournament.DirectTournament
- All Implemented Interfaces:
- Tournament, Configurable
public class DirectTournament
- extends SimpleTournament
- implements Configurable
Each contestant plays 1 game against each opponent.
- Author:
- Philip Tucker
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DirectTournament
public DirectTournament(Game aGame,
ScoringWeights aWeights,
java.util.Random aRand)
- Parameters:
aGame
- aWeights
- aRand
- used to shuffle order of opponents
DirectTournament
public DirectTournament()
- default ctor; should be followed by
init()
init
public void init(Properties props)
throws java.lang.Exception
- Specified by:
init
in interface Configurable
- Overrides:
init
in class SimpleTournament
- Parameters:
props
- configuration parameters
- Throws:
java.lang.Exception
- See Also:
Configurable.init(com.anji.util.Properties)
addOpponents
public void addOpponents(java.util.Collection opponents)
- add multiple opponents
- Parameters:
opponents
- Collection
contains Player
objects
addOpponent
public void addOpponent(Player opponent)
- Parameters:
opponent
-
hasNextPlayerPair
protected boolean hasNextPlayerPair()
- Specified by:
hasNextPlayerPair
in class SimpleTournament
- Returns:
- boolean true if player pairs are stil available
- See Also:
SimpleTournament.hasNextPlayerPair()
nextPlayerPair
protected SimpleTournament.PlayerPair nextPlayerPair()
- Specified by:
nextPlayerPair
in class SimpleTournament
- Returns:
- next pair of players
- See Also:
SimpleTournament.nextPlayerPair()
startTournament
protected void startTournament()
- Description copied from class:
SimpleTournament
- restart tournament
- Specified by:
startTournament
in class SimpleTournament
- See Also:
SimpleTournament.startTournament()
getMaxScore
public int getMaxScore()
- Specified by:
getMaxScore
in interface Tournament
- Returns:
- maximum possible score a contestant can achieve in this tournament; this value may
change as contestants are added; refers to
TournamentPlayerResults.getTournamentScore()
not
TournamentPlayerResults.getScore()
- See Also:
Tournament.getMaxScore()
getOpponentsAndResults
public java.util.List getOpponentsAndResults()
- Returns:
List
contains opponent PlayerResults
objects
getMinScore
public int getMinScore()
- Specified by:
getMinScore
in interface Tournament
- Returns:
- minimum possible score a contestant can achieve in this tournament; this value may
change as contestants are added; refers to
TournamentPlayerResults.getTournamentScore()
not
TournamentPlayerResults.getScore()
- See Also:
Tournament.getMinScore()
endTournament
protected void endTournament()
- Description copied from class:
SimpleTournament
- end tournament
- Specified by:
endTournament
in class SimpleTournament
- See Also:
SimpleTournament.endTournament()