loadAndEntryGame

suspend fun loadAndEntryGame(gameName: String, playerName: String? = null, desiredType: PieceType?, service: GameServiceImpl): Game

Loads an existing game from storage. It is recommended to use this method only connecting to a not local game. Ensures that the player with the specified piece type is included in the loaded game. Removes the player from storage to avoid conflicts in future loads.

Return

The loaded game state.

Parameters

gameName

The name of the game to load.

Throws

if there is an error loading the game state.

if the specified piece type is not found in the loaded game.