-
Notifications
You must be signed in to change notification settings - Fork 5
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
Branch house #61
Conversation
import seedu.address.model.house.*; | ||
import seedu.address.model.person.*; |
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.
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.*; |
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.
avoid using .*
for imports
boolean HASBLOCK = true; | ||
boolean HASLEVEL = true; |
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.
avoid using ALL CAPS for non-constant variables
* 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. |
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.
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"}; |
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.
I think you can consider using enums for this one
/** | ||
* Constructs a {@code Level}. | ||
* | ||
* @param postalCode The postal code of the house. | ||
* @param street The street of the house. | ||
*/ |
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.
Wrong javadocs description here and incomplete params
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(); | ||
} |
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.
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); |
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.
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}. |
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.
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); |
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.
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) { |
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.
What's this overloaded constructor for?
Add House class and capabilities. Replace address