예제 #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());
              }
        }