示例#1
0
        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();
            }
        }
示例#2
0
        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();
            }
        }
示例#3
0
 public void Start()
 {
     process.Start();
     process.UciNewGame();
 }