startNewGame

suspend fun startNewGame(side: Int, players: MatchPlayers, firstTurn: PieceType, currGameName: String? = null, service: GameServiceImpl): Game

Starts a new game. It is recommended to use this method only to create a not local game. If is not a local game makes available the opponent player in storage for future loads.

Return

The new game state.

Parameters

side

The side length of the board (required).

players

The list of players.

firstTurn

The piece type of the player who goes first can omit to use the default.

currGameName

The current game name can omit to create a local game.

Throws

if no players are provided.

if already exists a game with the same name in storage.