Beispiel #1
0
        private void ProcessUCIData(string uciData)
        {
            if (uciData == null)
            {
                return;
            }

            if (uciData.StartsWith("bestmove"))
            {
                //if (this.Game.Flags.IsProcessOutputInInfiniteAnalysis)
                //{
                //    this.Game.Flags.IsProcessOutputInInfiniteAnalysis = false;
                //}
                ProcessBestMove(uciData);
            }
            //else if (this.Game.Flags.IsProcessOutputInInfiniteAnalysis)
            //{
            //    return;
            //}
            else if (uciData.StartsWith("uciok"))
            {
                ProcessUciOk();
            }
            else if (uciData.StartsWith("Illegal move\n"))
            {
                if (IllegalMove != null)
                {
                    UCIIllegalMoveEventArgs e = new UCIIllegalMoveEventArgs(uciData, uciData);
                    IllegalMove(this, e);
                }
            }
            else if (uciData.StartsWith("Error\n"))
            {
                if (Error != null)
                {
                    UCIErrorEventArgs e = new UCIErrorEventArgs(uciData);
                    Error(this, e);
                }
            }
            else if (uciData.StartsWith("id name"))
            {
                string uciName = uciData.Substring("id name".Length);
                this.id = uciName;
                if (NameReceived != null)
                {
                    UCIMessageEventArgs e = new UCIMessageEventArgs(uciName);
                    NameReceived(this, e);
                }
            }
            else if (uciData.StartsWith("id author"))
            {
                string uciAuthor = uciData.Substring("id author".Length);
                this.author = uciAuthor;
                if (AuthorReceived != null)
                {
                    UCIMessageEventArgs e = new UCIMessageEventArgs(uciAuthor);
                    AuthorReceived(this, e);
                }
            }
            else if (uciData.StartsWith("option name"))
            {
                ProcessOptionName(uciData);
            }
            else if (uciData.StartsWith("readyok") && !IsKibitzer)
            {
                if (!IsHashCleared)
                {
                    SendOption(OptionClear + " " + OptionHash);
                }
            }
            else if (uciData.StartsWith("info "))
            {
                ProcessInfo(uciData);
            }
        }
Beispiel #2
0
 void _engine_IllegalMove(object sender, UCIIllegalMoveEventArgs e)
 {
 }