Example #1
0
        public void Undo()
        {
            if (doneCommands.Count <= 0)
            {
                return;
            }
            EditorCommand command = doneCommands.Pop();

            command.Revertir();
            undoneCommands.Push(command);
        }
Example #2
0
        public void Redo()
        {
            if (undoneCommands.Count <= 0)
            {
                return;
            }
            EditorCommand command = undoneCommands.Pop();

            command.Ejecutar();
            doneCommands.Push(command);
        }
Example #3
0
 public void Do(EditorCommand command)
 {
     command.Ejecutar();
     doneCommands.Push(command);
     undoneCommands.Clear();
 }