コード例 #1
0
        public UciProcess(UciEngineSettings settings)
        {
            resetEvent = new System.Threading.AutoResetEvent(false);
            Options    = new List <UciOption>();
            Settings   = settings;

            var startInfo = new ProcessStartInfo()
            {
                Arguments              = settings.Parameters,
                CreateNoWindow         = true,
                FileName               = settings.Command,
                RedirectStandardError  = true,
                RedirectStandardInput  = true,
                RedirectStandardOutput = true,
                StandardErrorEncoding  = Encoding.UTF8,
                StandardOutputEncoding = Encoding.UTF8,
                UseShellExecute        = false,
                WindowStyle            = ProcessWindowStyle.Hidden
                                         //WorkingDirectory = ""
            };

            engineProcess = new Process {
                StartInfo = startInfo, EnableRaisingEvents = true
            };
            engineProcess.OutputDataReceived += (s, e) => ReadCommand(e.Data);
        }
コード例 #2
0
ファイル: MasterState.cs プロジェクト: adh2050/Chess
 public UciEngineSettings CreateNewEngine()
 {
     var engine = new UciEngineSettings { Name = "New Engine" };
     engine.Id = engines.Max(x => x.Id) + 1;
     engines.Add(engine);
     TriggerAction(EventEnginesChanged);
     return engine;
 }
コード例 #3
0
ファイル: MasterState.cs プロジェクト: adh2050/Chess
 public void RemoveEngine(UciEngineSettings engine)
 {
     if (engines.Contains(engine))
     {
         engines.Remove(engine);
         TriggerAction(EventEnginesChanged);
     }
 }
コード例 #4
0
ファイル: MasterState.cs プロジェクト: adh2050/Chess
        public UciEngineSettings CreateNewEngine()
        {
            var engine = new UciEngineSettings {
                Name = "New Engine"
            };

            engine.Id = engines.Max(x => x.Id) + 1;
            engines.Add(engine);
            TriggerAction(EventEnginesChanged);
            return(engine);
        }
コード例 #5
0
ファイル: UciProcess.cs プロジェクト: adh2050/Chess
        public UciProcess(UciEngineSettings settings)
        {
            resetEvent = new System.Threading.AutoResetEvent(false);
            Options = new List<UciOption>();
            Settings = settings;

            var startInfo = new ProcessStartInfo()
            {
                Arguments = settings.Parameters,
                CreateNoWindow = true,
                FileName = settings.Command,
                RedirectStandardError = true,
                RedirectStandardInput = true,
                RedirectStandardOutput = true,
                StandardErrorEncoding = Encoding.UTF8,
                StandardOutputEncoding = Encoding.UTF8,
                UseShellExecute = false,
                WindowStyle = ProcessWindowStyle.Hidden
                //WorkingDirectory = ""
            };

            engineProcess = new Process { StartInfo = startInfo, EnableRaisingEvents = true };
            engineProcess.OutputDataReceived += (s, e) => ReadCommand(e.Data);
        }
コード例 #6
0
ファイル: UciEnginePlayer.cs プロジェクト: adh2050/Chess
 public UciEnginePlayer(UciEngineSettings settings)
 {
     Settings = settings;
     process  = new UciProcess(settings);
 }
コード例 #7
0
ファイル: UciEnginePlayer.cs プロジェクト: adh2050/Chess
 public UciEnginePlayer(UciEngineSettings settings)
 {
     Settings = settings;
     process = new UciProcess(settings);
 }
コード例 #8
0
ファイル: MasterState.cs プロジェクト: adh2050/Chess
 public void RemoveEngine(UciEngineSettings engine)
 {
     if (engines.Contains(engine))
     {
         engines.Remove(engine);
         TriggerAction(EventEnginesChanged);
     }
 }