/// <summary>
        ///     Undo the last command that has been done
        /// </summary>
        /// <returns>The last command, null if there is none</returns>
        public ICompensableCommand Undo()
        {
            if (_undoCommands.Count == 0)
            {
                return(null);
            }

            ICompensableCommand command = _undoCommands.Pop();

            command.Compensate();
            _redoCommands.Push(command);

            return(command);
        }
 public void Compensate()
 {
     _kingCommand.Compensate();
     _rookCommand.Compensate();
 }
Example #3
0
 public void Compensate()
 {
     _secondMove.Compensate();
     _firstMove.Compensate();
 }
 public void Compensate()
 {
     _board.SquareAt(Move.TargetCoordinate).Piece = _oldPawn;
     _moveCommand.Compensate();
 }