Пример #1
0
    private void Move(Direction direction)
    {
        MyRemoveCommand removeCommand = new MyRemoveCommand(removeCommandReceiver, direction, moveObject, distance);

        removeCommand.Execute();
        rCommands.Add(removeCommand);
        currentNum++;
    }
Пример #2
0
 public void Redo()
 {
     if (currentNum < rCommands.Count)
     {
         MyRemoveCommand removeCommand = (MyRemoveCommand)rCommands[currentNum];
         currentNum++;
         removeCommand.Execute();
     }
 }
Пример #3
0
 public void Undo()
 {
     if (currentNum > 0)
     {
         currentNum--;
         MyRemoveCommand removeCommand = (MyRemoveCommand)rCommands[currentNum];
         removeCommand.UnExecute();
     }
 }