-
Notifications
You must be signed in to change notification settings - Fork 73
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
[W6.2b][F09-4] Andrew Ong Ming En #115
base: master
Are you sure you want to change the base?
Conversation
… mutated in logic.java
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job! As you add or modify methods, also remember to write comment to document it.
@@ -70,4 +70,8 @@ public int getTargetIndex() { | |||
public void setTargetIndex(int targetIndex) { | |||
this.targetIndex = targetIndex; | |||
} | |||
|
|||
public boolean isMutating() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
alternatively, this could also be specified as abstract, since all commands have their own implementation based on their behavior
@@ -85,7 +85,10 @@ public CommandResult execute(String userCommandText) throws Exception { | |||
private CommandResult execute(Command command) throws Exception { | |||
command.setData(addressBook, lastShownList); | |||
CommandResult result = command.execute(); | |||
storage.save(addressBook); | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since now the storage is only updated when a command is mutation, the header comment should be updated accordingly to reflect the change.
Added isMutating boolean to all command classes
storage.save only if command is mutated in logic.java