You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My thought of implementing this was: We update abstract class Command to add an abstract method called reverseExecute(). All Command classes would have to implement this method which basically does the exact opposite of what the execute() command originally did. Then we can just maintain a stack of Commands and as the user calls 'undo', get the last command from the stack and call reverseExecute() on it.
so that I can easily correct any accidental mistakes in the last command
The text was updated successfully, but these errors were encountered: