Beispiel #1
0
 public void Undo(int cur)
 {
     for (int i = 0; i < cur; i++)
     {
         if (current > 0)
         {
             current--;
             Command command = commands[current];
             command.Undo();
         }
     }
 }
 public void Undo(int levels)
 {
     for (int i = 0; i < levels; i++)
     {
         if (current > 0)
         {
             Command command = commands[--current];
             commands.Remove(command);
             command.Undo();
         }
     }
 }
Beispiel #3
0
        public override void Execute(GameObject self, Command a_command)
        {
            //
            //Debug.Log("Undoing last command");
            List <Command> commandHistory = InputManager.commandHistory;

            if (commandHistory.Count > 0)
            {
                //
                Command latestCommand = commandHistory[commandHistory.Count - 1];
                //
                latestCommand.Undo(self);
                //
                commandHistory.RemoveAt(commandHistory.Count - 1);
            }
        }
 public void desfazer()
 {
     ultimoCommand.Undo();
 }
 public void ButtonUp()
 {
     command.Undo();
 }