public void Save(string fileName) { var game = new SavedGame { AvailableSuits = _availableSuits, Collection = Collection, IsGameOver = IsGameOver, TopCount = _topCount, Steps = _steps, Score = Score }; XmlUtilities<SavedGame>.Serialize(game, fileName); }
public void Resore(SavedGame game) { Clear(); IsGameOver = game.IsGameOver; IsSomethingSelected = false; Score = game.Score; _topCount = game.TopCount; _availableSuits.AddRange(game.AvailableSuits); _collection.Copy(game.Collection, _availableSuits); _steps.AddRange(game.Steps); NotifyCardsChanged(); }