示例#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
 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
 public void RemoveEngine(UciEngineSettings engine)
 {
     if (engines.Contains(engine))
     {
         engines.Remove(engine);
         TriggerAction(EventEnginesChanged);
     }
 }
示例#4
0
        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
        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
 public UciEnginePlayer(UciEngineSettings settings)
 {
     Settings = settings;
     process  = new UciProcess(settings);
 }
示例#7
0
 public UciEnginePlayer(UciEngineSettings settings)
 {
     Settings = settings;
     process = new UciProcess(settings);
 }
示例#8
0
 public void RemoveEngine(UciEngineSettings engine)
 {
     if (engines.Contains(engine))
     {
         engines.Remove(engine);
         TriggerAction(EventEnginesChanged);
     }
 }