Package com.codingame.gameengine.core
Class SoloGameManager<T extends AbstractSoloPlayer>
java.lang.Object
com.codingame.gameengine.core.GameManager<T>
com.codingame.gameengine.core.SoloGameManager<T>
- Type Parameters:
T
- Your implementation of AbstractMultiplayerPlayer
The
AbstractMultiplayerPlayer
takes care of running each turn of a multiplayer game and computing each visual frame of the replay. It
provides many utility methods that handle instances of your implementation of AbstractMultiplayerPlayer.-
Field Summary
Fields inherited from class com.codingame.gameengine.core.GameManager
log, out, players
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
protected com.codingame.gameengine.core.OutputCommand
Get the playerReturns the current test case the game got at initialization.void
loseGame()
Ends the game as a failvoid
Ends the game as a fail with a red messageprotected void
readGameProperties
(com.codingame.gameengine.core.InputCommand iCmd, Scanner s) void
winGame()
Ends the game as a victoryvoid
Ends the game as a victory with a green message.Methods inherited from class com.codingame.gameengine.core.GameManager
addToGameSummary, addTooltip, addTooltip, dumpGameProperties, endGame, execute, formatErrorMessage, formatSuccessMessage, getFirstTurnMaxTime, getFrameDuration, getLeagueLevel, getMaxTurns, getTurnMaxTime, isGameEnd, putMetadata, registerModule, setFirstTurnMaxTime, setFrameDuration, setMaxTurns, setTurnMaxTime, setViewData, setViewData, setViewGlobalData
-
Constructor Details
-
SoloGameManager
public SoloGameManager()
-
-
Method Details
-
readGameProperties
- Specified by:
readGameProperties
in classGameManager<T extends AbstractSoloPlayer>
-
getTestCaseInput
Returns the current test case the game got at initialization.You can set it with the
SoloGameRunner
.- Returns:
- The test case for this game.
-
getPlayer
Get the player- Returns:
- player
-
winGame
public void winGame()Ends the game as a victory -
loseGame
public void loseGame()Ends the game as a fail -
winGame
Ends the game as a victory with a green message.- Parameters:
message
- the message to display in green
-
loseGame
Ends the game as a fail with a red message- Parameters:
message
- the message to display in red
-
allPlayersInactive
protected boolean allPlayersInactive()- Specified by:
allPlayersInactive
in classGameManager<T extends AbstractSoloPlayer>
-
getGameSummaryOutputCommand
protected com.codingame.gameengine.core.OutputCommand getGameSummaryOutputCommand()- Specified by:
getGameSummaryOutputCommand
in classGameManager<T extends AbstractSoloPlayer>
-