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

Branch house #61

Conversation

redcolorbicycle
Copy link

Add House class and capabilities. Replace address

Comment on lines +23 to +24
import seedu.address.model.house.*;
import seedu.address.model.person.*;

Choose a reason for hiding this comment

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

same with these imports

@@ -21,6 +26,7 @@
import seedu.address.logic.Messages;
import seedu.address.logic.commands.exceptions.CommandException;
import seedu.address.model.Model;
import seedu.address.model.house.*;

Choose a reason for hiding this comment

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

avoid using .* for imports

Comment on lines +38 to +39
boolean HASBLOCK = true;
boolean HASLEVEL = true;

Choose a reason for hiding this comment

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

avoid using ALL CAPS for non-constant variables

Comment on lines +135 to +138
* Parses a {@code String street} into a {@code Street}.
* Leading and trailing whitespaces will be trimmed.
*
* @throws ParseException if the given {@code street} is invalid.

Choose a reason for hiding this comment

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

Wrong javadocs desscription

public class House {
public static final String MESSAGE_CONSTRAINTS =
"Housing types can only be HDB, Condominium or Landed.";
public static final String[] VALIDATION_REGEX = {"hdb", "condominium", "landed"};

Choose a reason for hiding this comment

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

I think you can consider using enums for this one

Comment on lines +18 to +23
/**
* Constructs a {@code Level}.
*
* @param postalCode The postal code of the house.
* @param street The street of the house.
*/

Choose a reason for hiding this comment

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

Wrong javadocs description here and incomplete params

Comment on lines +24 to +50
public House(UnitNumber unitNumber, PostalCode postalCode, Street street) {
this.postalCode = postalCode;
this.street = street;
this.unitNumber = unitNumber;
}

public House(UnitNumber unitNumber, House house) {
this.unitNumber = unitNumber;
this.postalCode = house.getPostalCode();
this.street = house.getStreet();
}
public House(PostalCode postalCode, House house) {
this.unitNumber = house.getUnitNumber();
this.postalCode = house.getPostalCode();
this.street = house.getStreet();
}
public House(Street street, House house) {
this.unitNumber = house.getUnitNumber();
this.postalCode = house.getPostalCode();
this.street = street;
}

public House(House house) {
this.unitNumber = house.getUnitNumber();
this.postalCode = house.getPostalCode();
this.street = house.getStreet();
}

Choose a reason for hiding this comment

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

I think for the House constructor we just need these two params Postal and Street. Can refer to the rough sketch of our class diagram in telegram.

* @param street The street of the house.
*/
public Landed(UnitNumber unitNumber, PostalCode postalCode, Street street) {
super(unitNumber, postalCode, street);

Choose a reason for hiding this comment

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

I think to show proper inheritance we can separate this out to something like:

from:
super(unitNumber, postalCode, street);
to
super(postalCode, street);
this.unitNumber = unitNumber;



/**
* Constructs a {@code Level}.

Choose a reason for hiding this comment

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

Remember to change the javadocs description here too.

* @param unitNumber The unit number of the house.
*/
public NonLanded(Block block, Level level, PostalCode postalCode, Street street, UnitNumber unitNumber) {
super(unitNumber, postalCode, street);

Choose a reason for hiding this comment

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

Can change to something like this super(postalCode, street);
The rest of the class variables looks good 👍

* @param street The street of the house.
* @param unitNumber The unit number of the house.
*/
public NonLanded(Level level, PostalCode postalCode, Street street, UnitNumber unitNumber) {

Choose a reason for hiding this comment

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

What's this overloaded constructor for?

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.

2 participants