ChessDemo.MainWindow.redoButton_Click C# (CSharp) 메소드

redoButton_Click() 개인적인 메소드

private redoButton_Click ( object sender, RoutedEventArgs e ) : void
sender object
e System.Windows.RoutedEventArgs
리턴 void
        private void redoButton_Click(object sender, RoutedEventArgs e)
        {
            if (redoMoves.Count == 0)
                return;

            var moveWithDecition = redoMoves.Last();
            redoMoves.RemoveAt(redoMoves.Count - 1);

            this.gameProvider.ProcessMove(moveWithDecition.Move,
                this.chessboardControl.CurrentPlayerColor);

            this.chessboardControl.AnimateLast();

            if (moveWithDecition.Decision != Queem.Core.Figure.Nobody)
            {
                this.chessboardControl.PromotePawn(
                    this.chessboardControl.CurrentPlayerColor,
                    moveWithDecition.Move.To,
                    moveWithDecition.Decision);
            }

            this.chessboardControl.ChangeCurrentPlayer();

            this.redoButton.IsEnabled = (this.redoMoves.Count > 0);
        }