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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanprotected com.codingame.gameengine.core.OutputCommandGet the playerReturns the current test case the game got at initialization.voidloseGame()Ends the game as a failvoidEnds the game as a fail with a red messageprotected voidreadGameProperties(com.codingame.gameengine.core.InputCommand iCmd, Scanner s) voidwinGame()Ends the game as a victoryvoidEnds 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:
readGamePropertiesin 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:
allPlayersInactivein classGameManager<T extends AbstractSoloPlayer>
-
getGameSummaryOutputCommand
protected com.codingame.gameengine.core.OutputCommand getGameSummaryOutputCommand()- Specified by:
getGameSummaryOutputCommandin classGameManager<T extends AbstractSoloPlayer>
-