Beispiel #1
0
 // parses a PGN and does all moves
 public virtual void SetBoard(Board b, string pgn)
 {
     ParsePgn(pgn);
     b.SetFen(fenStartPosition);
     foreach (string moveString in moves)
     {
         if ("*".Equals(moveString))
         {
             break;
         }
         int move = Move.GetFromString(b, moveString, true);
         if (move == 0 || move == -1)
         {
             logger.Error("Move not Parsed: " + moveString);
             break;
         }
         if (!b.DoMove(move))
         {
             logger.Error("Doing move=" + moveString + " " + Move.ToStringExt(move) + " " + b.
                 GetTurn());
             break;
         }
     }
 }