public bool Deserialize(Dictionary <string, string> sections, Deck deck) { if (sections.Count == 0) { return(false); } Dictionary <string, string> game = StaticHelpers.DeserializeDictionary(sections["Game"]); if (sections == null) { return(false); } if (game["Version"] != SERIALIZATION_VERSION) { return(false); } _dealer = (PlayerType)Enum.Parse(typeof(PlayerType), game["Dealer"]); NewGame(_dealer, deck); CardView shared = StaticHelpers.CardFromString(game["SharedCard"], deck); _deck.SharedCard = shared; _player.Deserialize(sections["Player"], deck); _computer.Deserialize(sections["Computer"], deck); string countingPhase; if (sections.TryGetValue("Counting", out countingPhase)) { _countingPhase = new CountingPhase(_player, _player.Hand.Cards, _computer, _computer.Hand.Cards); _countingPhase.Deserialize(countingPhase, deck); CountingState state = new CountingState(_player, _computer); state.Deserialize(sections["CountingState"]); _countingPhase.State = state; } return(true); }