public static StoredGameState Build(SerializableGameState storedState) { return(new StoredGameState { Grid = new GameGrid(storedState.Size, storedState.Tiles), KeepPlaying = storedState.KeepPlaying, Over = storedState.Over, Score = storedState.Score, Won = storedState.Won }); }
public async Task SetGameState(IGameState gameState) { await WriteToFile(_gameStateFileName, JsonConvert.SerializeObject(SerializableGameState.Build(gameState))).ConfigureAwait(false); System.Diagnostics.Debug.WriteLine("GameState Saved!"); }