/// <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);
        }
Exemplo n.º 2
0
 public void Compensate()
 {
     _kingCommand.Compensate();
     _rookCommand.Compensate();
 }
Exemplo n.º 3
0
 public void Compensate()
 {
     _secondMove.Compensate();
     _firstMove.Compensate();
 }
Exemplo n.º 4
0
 public void Compensate()
 {
     _board.SquareAt(Move.TargetCoordinate).Piece = _oldPawn;
     _moveCommand.Compensate();
 }