public class TournamentControl extends Object
Constructor and Description |
---|
TournamentControl(EngineControl engineControl,
GameControlList gameControlList,
String name)
Standard constructor
|
TournamentControl(GameControlList gameControlList,
String name)
Deprecated.
Standard constructor
|
Modifier and Type | Method and Description |
---|---|
Integer |
addClientsToTournament(Collection<de.smarten.tsuro.shared.gamemodel.Client> clients)
Add a list of clients to the tournament.
|
void |
addConfigurations(Collection<de.smarten.tsuro.shared.gamemodel.Configuration> configs)
Add a list of configurations to the tournament.
|
TournamentBracketModel |
getTournamentBracketModel()
Getter for the TournamentBracketModel of this tournament.
|
List<de.smarten.tsuro.shared.gamemodel.Client> |
getTournamentClients()
returns a list of all clients in the tournament
|
List<de.smarten.tsuro.shared.gamemodel.Client> |
removeClientsFromTournament()
Remove all clients from the tournament.
|
void |
removeConfigurations(Collection<de.smarten.tsuro.shared.gamemodel.Configuration> configs)
remove a list of configurations from the tournament.
|
void |
setFirstLevelConfiguration(de.smarten.tsuro.shared.gamemodel.Configuration config)
sets the configuration for the first level of the tournament.
|
void |
setFirstLevelGameCount(int startNumberOfGames)
Sets the number of games for the first round at the beginning of the tournament.
|
void |
startCurrentLevel()
Starts the next level of the tournament.
|
void |
startTournament()
Starts the Tournament
|
void |
tournamentEnds(de.smarten.tsuro.shared.gamemodel.Client winner)
sends an update to the
EngineControl that the tournament is ending with a winner. |
public TournamentControl(EngineControl engineControl, GameControlList gameControlList, String name)
gameControlList
- the given game control listname
- tournament's name.public TournamentControl(GameControlList gameControlList, String name)
gameControlList
- the given game control listname
- tournament's name.public TournamentBracketModel getTournamentBracketModel()
public void addConfigurations(Collection<de.smarten.tsuro.shared.gamemodel.Configuration> configs)
configs
- to addpublic void setFirstLevelConfiguration(de.smarten.tsuro.shared.gamemodel.Configuration config)
config
- the configuration that should be set for the first level of the tournamentpublic void removeConfigurations(Collection<de.smarten.tsuro.shared.gamemodel.Configuration> configs)
configs
- to be removed.public void setFirstLevelGameCount(int startNumberOfGames)
startNumberOfGames
- Number of Gamespublic Integer addClientsToTournament(Collection<de.smarten.tsuro.shared.gamemodel.Client> clients)
clients
- to addpublic List<de.smarten.tsuro.shared.gamemodel.Client> removeClientsFromTournament()
public void startTournament() throws IncompleteInputException, GameFullException
IncompleteInputException
- if the message string is emptyGameFullException
- if game unexpectedly becomes full before all clients could be addedpublic void startCurrentLevel() throws GameFullException, IncompleteInputException
level
- Index of the next level to be started.GameFullException
- see LevelControl.startLevel()
IncompleteInputException
public void tournamentEnds(de.smarten.tsuro.shared.gamemodel.Client winner)
EngineControl
that the tournament is ending with a winner.winner
- Client that wins the game.public List<de.smarten.tsuro.shared.gamemodel.Client> getTournamentClients()
Copyright © 2017 smarTen. All rights reserved.