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

Add checks for assign, unassign and reassign commands #110

Merged
merged 2 commits into from
Oct 28, 2020

Conversation

wakululuu
Copy link

Resolves #55

Copy link

@tnsyn tnsyn left a comment

Choose a reason for hiding this comment

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

LGTM, just a couple of very small comments only!

* This defines a stronger notion of equality between two role requirements.
*/
@Override
public boolean equals(Object other) {
return other == this
|| (other instanceof RoleRequirement
&& role.equals(((RoleRequirement) other).role)
&& quantity == ((RoleRequirement) other).quantity);
&& quantityRequired == ((RoleRequirement) other).quantityRequired
&& quantityRequired == ((RoleRequirement) other).quantityRequired);
Copy link

Choose a reason for hiding this comment

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

Possible duplication?

Copy link
Author

Choose a reason for hiding this comment

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

Good catch, thank you!

* Returns true if the quantity filled has not reached the quantity required.
*/
public boolean isFilled() {
assert quantityFilled <= quantityRequired;
Copy link

Choose a reason for hiding this comment

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

Would it be more meaningful to put this assertion in the constructor instead? Just a suggestion, not sure if it's good practice

Copy link
Author

Choose a reason for hiding this comment

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

Makes sense, edited

@tnsyn tnsyn merged commit a7d92fc into AY2021S1-CS2103-F10-4:master Oct 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add checks for assign command
2 participants