예제 #1
0
        void bw_DoWork(object sender, DoWorkEventArgs e)
        {
            UciEngineArgs args = e.Argument as UciEngineArgs;

            if (args != null)
            {
                StartSendMoveToKibitzer(args);
            }
        }
예제 #2
0
 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);
         }
     }
 }
예제 #3
0
        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;
                //}
            }
        }