public void UndoCommands(int nbUndos) { Console.WriteLine("Undo commands."); while (nbUndos > 0 && m_undoStack.Count > 0) { RobotCommandBase command = m_undoStack.Pop(); command.Undo(); nbUndos--; } }
public void ExcuteCommands() { Console.WriteLine("Excute commands."); while (Commmands.Count > 0) { RobotCommandBase command = Commmands.Dequeue(); command.Excute(); m_undoStack.Push(command); } }