public void SetMove(Move m) { if (m.Id == CurrentMove.Id) { return; } CurrentMove = m; Flags.IsMoveInProgress = true; Flags.IsClickedByUser = true; Clock.Stop(); Clock.SetClock(CurrentMove); Flags.IsRetracMove = false; Flags.IsMoveInProgress = false; Notations.Set(); Book.MoveTo(); SetFen(CurrentMove.Fen); //SetCapturedPiecesParameters(); //CapturedPieces.MoveTo(moveTo); }
public void MoveTo(MoveToE moveTo) { Move m = null; switch (moveTo) { case MoveToE.First: m = Moves.First; //Notations.MoveTo(moveTo); break; case MoveToE.Last: m = Moves.Last; break; case MoveToE.Next: m = Moves.Next(CurrentMove); //Notations.MoveTo(moveTo); break; case MoveToE.Previous: m = Moves.Prev(CurrentMove); //Notations.MoveTo(moveTo); break; case MoveToE.Up: break; case MoveToE.Down: break; default: break; } if (m == null && moveTo == MoveToE.Previous) { return; } if (m == null) { Book.MoveTo(moveTo, true); return; } if (CurrentMove.Id == m.Id) { Book.MoveTo(moveTo, true); } else { CurrentMove = m.Clone(); Flags.IsMoveInProgress = true; Flags.IsClickedByUser = true; Clock.Stop(); Clock.SetClock(CurrentMove); Flags.IsRetracMove = false; Flags.IsMoveInProgress = false; Notations.Set(); Book.MoveTo(moveTo, false); SetCapturedPiecesParameters(); CapturedPieces.MoveTo(moveTo); SetFen(CurrentMove.Fen); } }