void bw_DoWork(object sender, DoWorkEventArgs e) { UciEngineArgs args = e.Argument as UciEngineArgs; if (args != null) { StartSendMoveToKibitzer(args); } }
public void StartSendMoveToKibitzer(UciEngineArgs args) { if (kibitzersList == null) { return; } foreach (AnalysisUc kibitzer in kibitzersList) { if (this.Game.Flags.IsBoardSetByFen) { kibitzer.UCIEngine.SendPositionGo(false, this.Game.InitialBoardFen, args.Moves, args.WhiteTime, args.BlackTime); } else { kibitzer.UCIEngine.SendPositionGo(false, string.Empty, args.Moves, args.WhiteTime, args.BlackTime); } } }
public void SendMoveToKibitzerBW(string moves, long whiteTurnSeconds, long blackTurnSeconds) { if (bw.IsBusy) { bw.CancelAsync(); } if (!bw.IsBusy) { //try { UciEngineArgs args = new UciEngineArgs(moves, whiteTurnSeconds, blackTurnSeconds); bw.RunWorkerAsync(args); } //catch (Exception ex) //{ // string s = ex.Message; //} } }