Exemple #1
0
    private void Move(Direction direction)
    {
        MyRemoveCommand removeCommand = new MyRemoveCommand(removeCommandReceiver, direction, moveObject, distance);

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