public class GameControlList extends Object
GameControlList
manages multiple GameControl
s.Constructor and Description |
---|
GameControlList(ConnectionManager connectionManager)
Creates a new GameControlList, setting the ConnectionManager to be used.
|
Modifier and Type | Method and Description |
---|---|
de.smarten.tsuro.shared.gamemodel.JoinResponse |
addClientToGame(de.smarten.tsuro.shared.gamemodel.Client client,
int gameId)
Adds a client to a game.
|
GameControl |
getGameControlById(int gameId)
Returns the GameControl managing the game with the gameId passed or null,
if there is no game with the given gameId.
|
Iterator<GameControl> |
getGameControlsIterator()
Returns an iterator over all
GameControl s contained in this GameControlList. |
List<de.smarten.tsuro.shared.gamemodel.Game> |
getGames()
returns the list of games managed by the
GameControl s of this GameControlList |
GameControl |
getNewGameControl(String roomName,
de.smarten.tsuro.shared.gamemodel.Configuration config)
Adds a new
GameControl object to the list and returns it. |
public GameControlList(ConnectionManager connectionManager)
connectionManager
- the given connection managerpublic GameControl getNewGameControl(String roomName, de.smarten.tsuro.shared.gamemodel.Configuration config)
GameControl
object to the list and returns it.
Will also generate a new GameId and set it on the GameControl.roomName
- the given room nameconfig
- the given configurationpublic GameControl getGameControlById(int gameId)
gameId
- the id of the game managed by the GameControl to be returnedpublic Iterator<GameControl> getGameControlsIterator()
GameControl
s contained in this GameControlList.public de.smarten.tsuro.shared.gamemodel.JoinResponse addClientToGame(de.smarten.tsuro.shared.gamemodel.Client client, int gameId)
client
- the client to be addedgameId
- the id of the gameJoinResponse
public List<de.smarten.tsuro.shared.gamemodel.Game> getGames()
GameControl
s of this GameControlListCopyright © 2017 smarTen. All rights reserved.