Class GameManager
java.lang.Object
ru.hse.germandilio.tetris.client.controllers.GameManager
- All Implemented Interfaces:
AutoCloseable,ActionProvider,CommandSender
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Close listening socket and/or thread.voidendGame()End client game.voidEnd client game because fatal error.voidlaunch()voidplaceBrick(boolean[][] brick) Place brick that was sent by server.voidvoidsendCommand(String command) Send command.voidshowTopResults(List<ViewGameResult> results) Swot to user top list resultvoidStart client game.voidUnblock user.voidWait for opponent.voidWait for opponent starts game.
-
Constructor Details
-
GameManager
-
-
Method Details
-
launch
public void launch() -
registration
public void registration() -
showTopResults
Description copied from interface:ActionProviderSwot to user top list result- Specified by:
showTopResultsin interfaceActionProvider- Parameters:
results-Listof game session results
-
forceEndGame
public void forceEndGame()Description copied from interface:ActionProviderEnd client game because fatal error.- Specified by:
forceEndGamein interfaceActionProvider
-
endGame
public void endGame()Description copied from interface:ActionProviderEnd client game.- Specified by:
endGamein interfaceActionProvider
-
waitForEndGame
public void waitForEndGame()Description copied from interface:ActionProviderWait for opponent.- Specified by:
waitForEndGamein interfaceActionProvider
-
placeBrick
public void placeBrick(boolean[][] brick) Description copied from interface:ActionProviderPlace brick that was sent by server.- Specified by:
placeBrickin interfaceActionProvider- Parameters:
brick- Brick to place
-
startGame
public void startGame()Description copied from interface:ActionProviderStart client game.- Specified by:
startGamein interfaceActionProvider
-
waitForNewGame
public void waitForNewGame()Description copied from interface:ActionProviderWait for opponent starts game.- Specified by:
waitForNewGamein interfaceActionProvider
-
unblockUser
public void unblockUser()Description copied from interface:ActionProviderUnblock user.- Specified by:
unblockUserin interfaceActionProvider
-
sendCommand
Description copied from interface:CommandSenderSend command.- Specified by:
sendCommandin interfaceCommandSender- Parameters:
command-Stringrepresented command.
-
close
Description copied from interface:CommandSenderClose listening socket and/or thread.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCommandSender- Throws:
Exception- on closing
-