public class Game
extends AbstractGame
@NotNull public GameState getCurrentState()
@NotNull public Player onPlayerJoined()
TooManyPlayersException
- when game is already full@NotNull public java.util.List<sc.framework.plugins.Player> getWinners()
Returns the players that have won the game, empty if the game has no winners, or null if the game has not yet finished.
@NotNull public java.util.List<sc.shared.PlayerScore> getPlayerScores()
public boolean isGameOver()
@Nullable public WinCondition checkWinCondition()
Checks whether and why the game is over.
public void loadGameInfo(@NotNull java.lang.Object gameInfo)
The game is requested to load itself from a given game information object.
gameInfo
- the stored gameInformationpublic void loadFromFile(@NotNull java.lang.String file)
The game is requested to load itself from a file. Similar to a replay but with actual clients.
file
- File the game should be loaded frompublic void loadFromFile(@NotNull java.lang.String file, int turn)
The game is requested to load itself from a file. Similar to a replay but with actual clients.
file
- File where the game should be loaded fromturn
- The turn to load from the replay@NotNull public PlayerScore getScoreFor(@NotNull Player player)
@NotNull protected ActionTimeout getTimeoutFor(@NotNull Player player)
public void onRoundBasedAction(@NotNull Player fromPlayer, @NotNull ProtocolMessage data)
Called by onAction
to execute a move of a Player.
onAction
@NotNull public java.lang.String toString()