Class ServerGameManager
java.lang.Object
ru.hse.germandilio.tetris.server.game.ServerGameManager
- All Implemented Interfaces:
GameFlow,GameManager,GameSessions,PlayerConnection
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddisconnectPlayer(Connection client) voidendGame(Connection client) intintvoidgetTopSessions(Connection client, int topNumber) playerConnected(CommandSender clientHandler) booleanbooleanvoidsaveGameSessionResults(Connection client) voidsendEndGameWithoutResults(Connection client) voidsendNextBrick(Connection client, int indexInSequence) voidsendWaitingEndGame(Connection client) voidsendWaitingStartGame(Connection client) voidsetName(Connection client, String name) voidstartGame(Connection client)
-
Constructor Details
-
ServerGameManager
public ServerGameManager(int usersNumber, long maxSessionTime)
-
-
Method Details
-
getMaxUsersNumber
public int getMaxUsersNumber() -
getCurrentUsersCount
public int getCurrentUsersCount() -
playerConnected
- Specified by:
playerConnectedin interfacePlayerConnection
-
disconnectPlayer
- Specified by:
disconnectPlayerin interfacePlayerConnection
-
setName
- Specified by:
setNamein interfaceGameManager
-
readyToStartGame
public boolean readyToStartGame()- Specified by:
readyToStartGamein interfaceGameFlow
-
startGame
-
readyToEndGame
public boolean readyToEndGame()- Specified by:
readyToEndGamein interfaceGameFlow
-
endGame
-
sendWaitingStartGame
- Specified by:
sendWaitingStartGamein interfaceGameManager
-
sendWaitingEndGame
- Specified by:
sendWaitingEndGamein interfaceGameManager
-
sendEndGameWithoutResults
- Specified by:
sendEndGameWithoutResultsin interfaceGameManager
-
sendNextBrick
- Specified by:
sendNextBrickin interfaceGameManager
-
saveGameSessionResults
- Specified by:
saveGameSessionResultsin interfaceGameSessions
-
getTopSessions
- Specified by:
getTopSessionsin interfaceGameSessions
-