コード例 #1
0
ファイル: Uci.cs プロジェクト: Alfilchess/Engine
        //---------------------------------------------------------------------------------
        public static void SetPosicion(cPosicion posicion, Stack<string> lista)
        {
            mov m;
              string fen = string.Empty;
              string token = lista.Pop();

              if (token == "startpos")
              {
            fen = "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1";
            if (lista.Count > 0)
            {
              token = lista.Pop();
            }
              }
              else if (token == "fen")
            while ((lista.Count > 0) && (token = lista.Pop()) != "moves")
              fen += token + " ";
              else
            return;

              posicion.SetFEN(fen, cMotor.m_mapConfig["UCI_Chess960"].Get() != 0 ? true : false, cMotor.m_Threads.Principal());
              SetupStates = new Stack<cPosInfo>();

              while ((lista.Count > 0) && (m = cUci.GetFromUCI(posicion, token = lista.Pop())) != cMovType.MOV_NAN)
              {
            SetupStates.Push(new cPosInfo());
            posicion.DoMov(m, SetupStates.Peek());
              }
        }