private void SetPosition(string fen)
        {
            IsSettingPosition = true;

            BoardHistory.SetInitialPosition(fen);
            MoveHistory.Clear();
            Plies = 0;
            MoveHistory.Rows.Add();
            MoveHistory.Last().No = 1;
            if (BoardHistory.Current().GCD.WhoseTurn == Player.Black)
            {
                BoardHistory.DuplicateLast();
                MoveHistory.Last().WhiteDetailedMove = null;
                Plies = 1;
                SetSelection(1);
            }
            FirstPly = Plies;

            if (int.TryParse(fen.Split(' ').Last(), out int n))
            {
                BaseMoveNumber             = n;
                MoveHistory.BaseMoveNumber = n;
                foreach (MoveHistoryDataRow row in MoveHistory.Rows)
                {
                    row.UpdateBaseMoveNumber(n);
                }
            }

            UpdateFenTextBox(fen);

            IsSettingPosition = false;
        }
Beispiel #2
0
 private void ClearHistory()
 {
     MoveHistory.Clear();
     UndoHistory.Clear();
 }