1
0
Fork 0

Implement Society in Person class

This commit is contained in:
Ethanell 2020-04-01 18:25:52 +02:00
parent 1c5ca0b434
commit a04ebdae04

View file

@ -5,15 +5,15 @@ public class Person implements Input{
public String firstName[];
public Gender gender;
public Person spouse;
//public Society society;
public Society society;
public String function;
public Person(String lastName, String[] firstName, Gender gender, Person spouse, String function) {
public Person(String lastName, String[] firstName, Gender gender, Person spouse, Society society, String function) {
this.lastName = lastName;
this.firstName = firstName;
this.gender = gender;
this.spouse = spouse;
//this.society = society
this.society = society;
this.function = function;
}
@ -39,8 +39,8 @@ public class Person implements Input{
out += firstNames + " " + lastName;
else
out += lastName + " " + firstNames;
/*if (society != null)
out += " (" + society.socialReason + ")";*/
if (society != null)
out += " (" + society.socialReason + ")";
break;
case COMPLETE:
out = gender == Gender.MEN ? "Mr. " : "Ms. " ;
@ -50,8 +50,8 @@ public class Person implements Input{
out = firstNames + " " + lastName + "\n";
else
out = lastName + " " + firstNames + "\n";
/*if (society != null)
out += "\t- Society: " + society.socialReason + "\n";*/
if (society != null)
out += "\t- Society: " + society.socialReason + "\n";
if (!function.equals(""))
out += "\t- Function: " + function;
break;