diff --git a/MekHQ/src/mekhq/campaign/personnel/education/EducationController.java b/MekHQ/src/mekhq/campaign/personnel/education/EducationController.java index 13be9e4a1d..4a59c7ba7f 100644 --- a/MekHQ/src/mekhq/campaign/personnel/education/EducationController.java +++ b/MekHQ/src/mekhq/campaign/personnel/education/EducationController.java @@ -975,10 +975,6 @@ private static boolean graduateAdult(Campaign campaign, Person person, Academy a processGraduation(campaign, person, academy, 2, resources); - if (!academy.isMilitary()) { - reportMastersOrDoctorateGain(campaign, person, academy, resources); - } - person.setEduEducationStage(EducationStage.GRADUATING); person.changeLoyalty(academy.getDurationDays() / 300); @@ -1034,10 +1030,6 @@ private static boolean graduateAdult(Campaign campaign, Person person, Academy a processGraduation(campaign, person, academy, 1, resources); - if (!academy.isMilitary()) { - reportMastersOrDoctorateGain(campaign, person, academy, resources); - } - person.setEduEducationStage(EducationStage.GRADUATING); person.changeLoyalty(academy.getDurationDays() / 300); @@ -1086,10 +1078,6 @@ private static boolean graduateAdult(Campaign campaign, Person person, Academy a processGraduation(campaign, person, academy, 0, resources); - if (!academy.isMilitary()) { - reportMastersOrDoctorateGain(campaign, person, academy, resources); - } - person.setEduEducationStage(EducationStage.GRADUATING); person.changeLoyalty(academy.getDurationDays() / 300); @@ -1100,33 +1088,52 @@ private static boolean graduateAdult(Campaign campaign, Person person, Academy a /** * This method generates a report for individuals who have completed either a Master's or Doctorate degree. * - * @param campaign the campaign to add the report to - * @param person the person who completed the degree - * @param resources the resource bundle containing localized strings + * @param campaign the campaign to add the report to + * @param person the person who completed the degree + * @param education the education level taught by the academy + * @param resources the resource bundle containing localized strings */ - private static void reportMastersOrDoctorateGain(Campaign campaign, Person person, Academy academy, ResourceBundle resources) { - int education = academy.getEducationLevel(person) - 1; // we reduce by 1 to account for the +1 level from graduating - + private static void reportMastersOrDoctorateGain(Campaign campaign, Person person, Academy academy, + int education, ResourceBundle resources) { EducationLevel educationLevel = EducationLevel.parseFromInt(education); String qualification = academy.getQualifications().get(person.getEduCourseIndex()); String personName = person.getHyperlinkedFullTitle(); - String graduationLevel = ""; - if (educationLevel.isPostGraduate()) { - graduationLevel = resources.getString("graduatedMasters.text"); + ServiceLogger.eduGraduatedMasters( + person, + campaign.getLocalDate(), + person.getEduAcademyName(), + qualification + ); - ServiceLogger.eduGraduatedMasters(person, campaign.getLocalDate(), person.getEduAcademyName(), qualification); - } else if (educationLevel.isDoctorate()) { - graduationLevel = resources.getString("graduatedDoctorate.text"); + generatePostGradGraduationReport( + campaign, + personName, + resources.getString("graduatedMasters.text"), + qualification, + resources + ); - ServiceLogger.eduGraduatedDoctorate(person, campaign.getLocalDate(), person.getEduAcademyName(), qualification); + } else if (educationLevel.isDoctorate()) { + ServiceLogger.eduGraduatedDoctorate( + person, + campaign.getLocalDate(), + person.getEduAcademyName(), + qualification + ); person.setPreNominal("Dr"); - } - generatePostGradGraduationReport(campaign, personName, graduationLevel, qualification, resources); + generatePostGradGraduationReport( + campaign, + personName, + resources.getString("graduatedDoctorate.text"), + qualification, + resources + ); + } } /** @@ -1141,7 +1148,7 @@ private static void generatePostGradGraduationReport(Campaign campaign, String p String graduationText, String qualification, ResourceBundle resources) { campaign.addReport(String.format(resources.getString("graduatedPostGradReport.text"), personName, - "", + "", graduationText, "", qualification)); @@ -1246,7 +1253,6 @@ private static void processGraduation(Campaign campaign, Person person, Academy int educationLevel = academy.getEducationLevel(person); if (EducationLevel.parseToInt(person.getEduHighestEducation()) < educationLevel) { - LogManager.getLogger().info(educationLevel); person.setEduHighestEducation(EducationLevel.parseFromInt(educationLevel)); } @@ -1268,6 +1274,10 @@ private static void processGraduation(Campaign campaign, Person person, Academy } else { adjustLoyalty(person); } + + if (!academy.isMilitary()) { + reportMastersOrDoctorateGain(campaign, person, academy, educationLevel, resources); + } } /** @@ -1293,9 +1303,6 @@ private static void improveSkills(Campaign campaign, Person person, Academy acad } for (String skill : curriculum) { - LogManager.getLogger().info(skill); - LogManager.getLogger().info(educationLevel); - if (skill.equalsIgnoreCase("none")) { return; }