private void OnParse() { try { using (var controller = new GameController(Log)) { Game = controller.BuildField(); if (Game == null) { AddEntry(LogType.Error, "Поле не найдено"); return; } } AddEntry(LogType.Info, "Save game"); TypeSerializer <Session> .ToXmlFile(FileName, Game); BestSteps.Clear(); Navigator.Steps.AllKeys.Clear(); Navigator.CurrentStep = Game.Root; } catch (Exception ex) { AddEntry(new LogEntry(ex)); } }
private void FindBest() { var bests = Game.GetBests(); BestSteps.Clear(); foreach (var step in bests) { BestSteps.Add(step); } Navigator.CurrentStep = bests[0]; }