Class Academy

java.lang.Object
mekhq.campaign.personnel.education.Academy
All Implemented Interfaces:
Comparable<Academy>

public class Academy extends Object implements Comparable<Academy>
The Academy class represents an academy with various properties and methods.
  • Constructor Details

    • Academy

      public Academy()
      This class provides a no-arg constructor, which is necessary for the unmarshalling of XML.
    • Academy

      public Academy(String set, String name, String type, Boolean isMilitary, Boolean isReeducationCamp, Boolean isPrepSchool, String description, Integer factionDiscount, Boolean isFactionRestricted, List<String> locationSystems, Boolean isLocal, Boolean isHomeSchool, Integer constructionYear, Integer destructionYear, Integer closureYear, Integer tuition, Integer durationDays, Integer facultySkill, EducationLevel educationLevelMin, EducationLevel educationLevelMax, Integer ageMin, Integer ageMax, List<String> qualifications, List<String> curriculums, List<Integer> qualificationStartYears, Integer baseAcademicSkillLevel, Integer id)
      Constructs a new Academy object.
      Parameters:
      set - the set name of the academy
      name - the name of the academy
      type - the type of academy (used by autoAwards)
      isMilitary - indicates if the academy is a military academy (true) or not (false)
      isReeducationCamp - indicates if the academy is a reeducation camp (true) or not (false)
      isPrepSchool - indicates if the academy is focused on children (true) or not (false)
      description - the description of the academy
      factionDiscount - the discount offered by the academy to faction members
      isFactionRestricted - indicates if the academy is restricted to faction members (true) or not (false)
      isLocal - indicates if the academy is local (true) or not (false) (overrides locationSystems)
      isHomeSchool - indicates if the academy is a home school (true) or not (false)
      locationSystems - the list of location systems where the academy is present
      constructionYear - the year when the academy was constructed
      destructionYear - the year when the academy was destroyed
      tuition - the tuition fee for attending the academy
      durationDays - the duration of the academy in days
      facultySkill - the skill level of the academy's faculty
      educationLevelMin - the minimum education level required to attend the academy
      educationLevelMax - the maximum education level provided by the academy
      ageMin - the minimum age requirement to attend the academy
      ageMax - the maximum age accepted by the academy
      qualifications - the list of qualifications provided by the academy
      curriculums - the list of curriculums offered by the academy
      qualificationStartYears - the list of years when each qualification becomes available
      baseAcademicSkillLevel - the base skill level provided by the academy
      id - the id number of the academy, used for sorting academies in mhq
  • Method Details

    • getSet

      public String getSet()
      Retrieves the value of the "set" property for academies.
      Returns:
      The value of the "set" property.
    • setSet

      public void setSet(String set)
      Sets the value of the set variable for academies.
      Parameters:
      set - the value to be assigned to the set variable
    • getName

      public String getName()
      Retrieves the name of the academy.
      Returns:
      the name of the academy
    • setName

      public void setName(String name)
      Sets the name of the academy.
      Parameters:
      name - the new name to be set
    • getType

      public AcademyType getType()
      Gets the type of academy.
      Returns:
      The type of academy.
    • setType

      public void setType(String type)
      Sets the type of academy.
      Parameters:
      type - the type to be set.
    • isMilitary

      public Boolean isMilitary()
      Checks if the academy is a military academy.
      Returns:
      true if the academy is a military academy, false otherwise.
    • setIsMilitary

      public void setIsMilitary(boolean isMilitary)
      Sets the value indicating whether the academy is a military academy.
      Parameters:
      isMilitary - true if the academy is military, false otherwise.
    • isReeducationCamp

      public boolean isReeducationCamp()
      Determines if the academy is a reeducation camp.
      Returns:
      true, if the academy is a reeducation camp; otherwise, false.
    • isPrepSchool

      public Boolean isPrepSchool()
      Checks if the academy is a Prep School.
      Returns:
      true if the academy is a Prep School, false otherwise.
    • isLocal

      public Boolean isLocal()
      Checks if the academy is a local academy.
      Returns:
      true if the academy is a local academy, false otherwise.
    • isHomeSchool

      public Boolean isHomeSchool()
      Returns:
      true if the academy is a home school, false otherwise.
    • getDescription

      public String getDescription()
      Returns the description of the academy.
      Returns:
      The description of the academy.
    • setDescription

      public void setDescription(String description)
      Sets the description of the academy.
      Parameters:
      description - the new description for the academy
    • getLocationSystems

      public List<String> getLocationSystems()
      Retrieves the list of location systems where the academy is present.
      Returns:
      The list of location systems as a List of String.
    • setLocationSystems

      public void setLocationSystems(List<String> locationSystems)
      Sets the location systems for the academy.
      Parameters:
      locationSystems - the list of location systems to be set
    • getConstructionYear

      public Integer getConstructionYear()
      Returns the academy's construction year.
      Returns:
      the academy's construction year as an Integer value.
    • getDestructionYear

      public Integer getDestructionYear()
      Retrieves the academy's destruction year.
      Returns:
      The academy's destruction year, represented as an Integer.
    • getClosureYear

      public Integer getClosureYear()
      Retrieves the closure year of an academy.
      Returns:
      The closure year as an Integer.
    • getAgeMin

      public Integer getAgeMin()
      Retrieves the minimum age allowed at the academy.
      Returns:
      the minimum age allowed as an Integer.
    • getAgeMax

      public Integer getAgeMax()
      Retrieves the maximum age allowed at the academy.
      Returns:
      the maximum age allowed as an Integer.
    • getTuition

      public Integer getTuition()
      Retrieves the value of the academy's tuition.
      Returns:
      the academy's tuition value as an Integer.
    • setTuition

      public void setTuition(Integer tuition)
      Sets the tuition value.
      Parameters:
      tuition - the new tuition value to be set
    • getDurationDays

      public Integer getDurationDays()
      Retrieves course duration (in days).
      Returns:
      The course duration in days as an Integer.
    • getFactionDiscount

      public Integer getFactionDiscount()
      Retrieves the academy's faction discount value.
      Returns:
      The academy's discount value for the faction.
    • setFactionDiscount

      public void setFactionDiscount(Integer factionDiscount)
      Sets the faction discount raw value.
      Parameters:
      factionDiscount - the faction discount to set
    • getFacultySkill

      public Integer getFacultySkill()
      Retrieves faculty skill level.
      Returns:
      The faculty skill level as an Integer.
    • getEducationLevelMin

      public EducationLevel getEducationLevelMin()
      Returns the minimum academic tier value.
      Returns:
      The minimum academic tier value as an Integer.
    • setEducationLevelMin

      public void setEducationLevelMin(EducationLevel educationLevelMin)
      Sets the minimum education level required for admission.
      Parameters:
      educationLevelMin - the minimum education level required, as an Integer
    • setEducationLevelMax

      public void setEducationLevelMax(EducationLevel educationLevelMax)
      Sets the maximum education level provided by the academy.
      Parameters:
      educationLevelMax - the maximum education level to be set
    • getQualifications

      public List<String> getQualifications()
      Returns the list of qualification names.
      Returns:
      the list of qualification names.
    • getCurriculums

      public List<String> getCurriculums()
      Retrieves the skills improved by this academy.
      Returns:
      The skills improved by this academy as a String.
    • getQualificationStartYears

      public List<Integer> getQualificationStartYears()
      Retrieves the skills improved by this academy.
      Returns:
      The skills improved by this academy as a String.
    • getBaseAcademicSkillLevel

      public Integer getBaseAcademicSkillLevel()
      Retrieves the base skill level granted by this academy.
      Returns:
      the base skill level granted by this academy as an Integer
    • getId

      public Integer getId()
      Retrieves the ID of the academy.
      Returns:
      the ID of the academy
    • setId

      public void setId(Integer id)
      Sets the id of the academy.
      Parameters:
      id - The id to be set.
    • compareTo

      public int compareTo(Academy other)
      Compares an academy with this one by priority: xp, edge and name. Used for sorting.
      Specified by:
      compareTo in interface Comparable<Academy>
      Parameters:
      other - academy to be compared
      Returns:
      int used for sorting
    • getTuitionAdjusted

      public int getTuitionAdjusted(Person person)
      Retrieves the adjusted value of the academy's tuition based on the specified tier minimum and education level.
      Parameters:
      person - the person for whom the tuition is being calculated
      Returns:
      the adjusted tuition value as an Integer
    • getFactionDiscountAdjusted

      public Double getFactionDiscountAdjusted(Campaign campaign, Person person)
      Calculates the adjusted faction discount for a given person in a campaign.
      Parameters:
      campaign - the campaign the person belongs to
      person - the person receiving the discount
      Returns:
      the faction discount as a double value, between 0.00 and 1.00
    • getFilteredFaction

      public String getFilteredFaction(Campaign campaign, Person person, List<String> factions)
      Retrieves the first Faction not in conflict with person's Faction or the campaign Faction.
      Parameters:
      campaign - The campaign being played.
      person - The person for whom to filter the faction.
      factions - The factions to check eligibility against.
      Returns:
      The filtered faction for the local campus, or null if no faction is found.
    • isQualified

      public boolean isQualified(Person person)
      Checks if a person is qualified to enroll based on their highest education level.
      Parameters:
      person - The person to check qualification for.
      Returns:
      True, if the person's highest education level is greater than or equal to the minimum education level required, false otherwise.
    • hasRejectedApplication

      public boolean hasRejectedApplication(Person person)
      Checks if a person has a rejected application for a specific academy.
      Parameters:
      person - the person for whom to check the rejected applications
      Returns:
      true if the person has a rejected application for the given academy, false otherwise
    • getEducationLevel

      public int getEducationLevel(Person person)
      Calculates the education level of a qualification based on the applicant's highest prior education level and the range of education levels offered by the academy.
      Parameters:
      person - The person whose education level needs to be determined.
      Returns:
      The education level of the qualification.
    • isFactionConflict

      public Boolean isFactionConflict(Campaign campaign, Person person)
      Checks if there is a conflict between the factions related to the academy and person or campaign.
      Parameters:
      campaign - The campaign to check faction conflict with.
      person - The person to check the faction conflict with.
      Returns:
      true if there is a faction conflict, false otherwise.
    • getNearestCampus

      public static String getNearestCampus(Campaign campaign, List<String> campuses)
      Returns the nearest campus to a given campaign.
      Parameters:
      campaign - the campaign for which to find the nearest campus
      campuses - a list of campuses to consider
      Returns:
      the nearest campus to the campaign
    • getTooltip

      public String getTooltip(Campaign campaign, List<Person> personnel, int courseIndex, PlanetarySystem destination)
      Retrieves the tooltip for an academy, based on the number of persons in 'personnel'
      Parameters:
      campaign - The campaign to retrieve the tooltip for.
      personnel - The list of personnel.
      courseIndex - The index of the course.
      destination - The campus.
      Returns:
      The tooltip as a String.
    • skillParser

      public static String skillParser(String skill)
      Parses a given skill string and returns the corresponding skill type.
      Parameters:
      skill - the skill string to parse
      Returns:
      the corresponding skill code as a string
      Throws:
      IllegalStateException - if the skill string is unexpected or invalid