From a04ebdae04faf04eb9f967907bf7b7357170e2f9 Mon Sep 17 00:00:00 2001 From: flifloo Date: Wed, 1 Apr 2020 18:25:52 +0200 Subject: [PATCH] Implement Society in Person class --- src/input/Person.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/input/Person.java b/src/input/Person.java index fe97153..a8009a9 100644 --- a/src/input/Person.java +++ b/src/input/Person.java @@ -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;