Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix undo redo bugs #243

Merged
merged 8 commits into from
Nov 9, 2019
Merged

Conversation

OneArmyj
Copy link

@OneArmyj OneArmyj commented Nov 8, 2019

  • Change the entire bulk of initial Undo-Redo implementation

Closes #259
Closes #180
Closes #178
Closes #159

Comment on lines +49 to +53
if (!isUndoRedo) {
Event clearEvent = EventFactory.parse((UndoableCommand) this, model);
CommandHistory.addToUndoStack(clearEvent);
CommandHistory.clearRedoStack();
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since command is an abstract class, this block of code can be abstracted out to another method, and when the even is undoable, it calls said method within the execute method. This would reduce the number of duplicate codes since all undoable command has this block of code

@KxxMxxx KxxMxxx merged commit f60c492 into AY1920S1-CS2103T-T09-1:master Nov 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants