コード例 #1
0
ファイル: UciEngineSettings.cs プロジェクト: adh2050/Chess
        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
ファイル: UciEnginePlayer.cs プロジェクト: adh2050/Chess
 public UciEnginePlayer(UciEngineSettings settings)
 {
     Settings = settings;
     process  = new UciProcess(settings);
 }
コード例 #4
0
ファイル: UciEnginePlayer.cs プロジェクト: adh2050/Chess
 public UciEnginePlayer(UciEngineSettings settings)
 {
     Settings = settings;
     process = new UciProcess(settings);
 }