public void LoadEngineData() { var engine = new UciProcess(this); try { engine.Start(); EngineId = engine.IdName; AuthorId = engine.IdAuthor; var oldOptions = Options; Options = engine.Options.ToArray(); // apply defaults foreach (var opt in Options) { opt.Value = (opt.DefaultValue ?? "").ToString(); } // reapply the settings foreach (var oldOption in oldOptions) { var newOption = Options.SingleOrDefault(x => x.Name == oldOption.Name); if (newOption == null) continue; newOption.Value = oldOption.Value; } } finally { engine.Quit(); } }
public void LoadEngineData() { var engine = new UciProcess(this); try { engine.Start(); EngineId = engine.IdName; AuthorId = engine.IdAuthor; var oldOptions = Options; Options = engine.Options.ToArray(); // apply defaults foreach (var opt in Options) { opt.Value = (opt.DefaultValue ?? "").ToString(); } // reapply the settings foreach (var oldOption in oldOptions) { var newOption = Options.SingleOrDefault(x => x.Name == oldOption.Name); if (newOption == null) { continue; } newOption.Value = oldOption.Value; } } finally { engine.Quit(); } }
public UciEnginePlayer(UciEngineSettings settings) { Settings = settings; process = new UciProcess(settings); }