public class Pool extends Object
Modifier and Type | Method and Description |
---|---|
de.smarten.tsuro.shared.gamemodel.JoinResponse |
addClient(de.smarten.tsuro.shared.gamemodel.Client client)
Adds a
Client to the pool. |
static Pool |
getInstance() |
Iterator<de.smarten.tsuro.shared.gamemodel.Client> |
getPlayersIterator()
|
Iterator<de.smarten.tsuro.shared.gamemodel.Client> |
getSpectatorsIterator()
|
boolean |
moveClientToGame(de.smarten.tsuro.shared.gamemodel.Client client,
GameControl gameControl)
Deletes a client from the pool and adds it to the game managed by the GameControl passed
|
void |
removeClient(de.smarten.tsuro.shared.gamemodel.Client client) |
public static Pool getInstance()
public Iterator<de.smarten.tsuro.shared.gamemodel.Client> getSpectatorsIterator()
Iterator
over all waiting spectator Client
s registered in the
Pool
public Iterator<de.smarten.tsuro.shared.gamemodel.Client> getPlayersIterator()
Iterator
over all waiting player Client
s registered in the
Pool
public de.smarten.tsuro.shared.gamemodel.JoinResponse addClient(de.smarten.tsuro.shared.gamemodel.Client client)
Client
to the pool.client
- the Client
to be addedJoinResponse
public void removeClient(de.smarten.tsuro.shared.gamemodel.Client client)
public boolean moveClientToGame(de.smarten.tsuro.shared.gamemodel.Client client, GameControl gameControl) throws GameFullException
client
- the client to be added to the gamegameControl
- the GameControl that manages the game to add the client toGameFullException
- if the game already has maximum number of clients for a gameCopyright © 2017 smarTen. All rights reserved.