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