Class Academy
java.lang.Object
mekhq.campaign.personnel.education.Academy
- All Implemented Interfaces:
Comparable<Academy>
The Academy class represents an academy with various properties and methods.
-
Constructor Summary
ConstructorsConstructorDescriptionAcademy()
This class provides a no-arg constructor, which is necessary for the unmarshalling of XML.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. -
Method Summary
Modifier and TypeMethodDescriptionint
Compares an academy with this one by priority: xp, edge and name.Retrieves the maximum age allowed at the academy.Retrieves the minimum age allowed at the academy.Retrieves the base skill level granted by this academy.Retrieves the closure year of an academy.Returns the academy's construction year.Retrieves the skills improved by this academy.Returns the description of the academy.Retrieves the academy's destruction year.Retrieves course duration (in days).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.Returns the minimum academic tier value.Retrieves the academy's faction discount value.getFactionDiscountAdjusted
(Campaign campaign, Person person) Calculates the adjusted faction discount for a given person in a campaign.Retrieves faculty skill level.getFilteredFaction
(Campaign campaign, Person person, List<String> factions) Retrieves the first Faction not in conflict with person's Faction or the campaign Faction.getId()
Retrieves the ID of the academy.Retrieves the list of location systems where the academy is present.getName()
Retrieves the name of the academy.static String
getNearestCampus
(Campaign campaign, List<String> campuses) Returns the nearest campus to a given campaign.Returns the list of qualification names.Retrieves the skills improved by this academy.getSet()
Retrieves the value of the "set" property for academies.getTooltip
(Campaign campaign, List<Person> personnel, int courseIndex, PlanetarySystem destination) Retrieves the tooltip for an academy, based on the number of persons in 'personnel'Retrieves the value of the academy's tuition.int
getTuitionAdjusted
(Person person) Retrieves the adjusted value of the academy's tuition based on the specified tier minimum and education level.getType()
Gets the type of academy.boolean
hasRejectedApplication
(Person person) Checks if a person has a rejected application for a specific academy.isFactionConflict
(Campaign campaign, Person person) Checks if there is a conflict between the factions related to the academy and person or campaign.isLocal()
Checks if the academy is a local academy.Checks if the academy is a military academy.Checks if the academy is a Prep School.boolean
isQualified
(Person person) Checks if a person is qualified to enroll based on their highest education level.boolean
Determines if the academy is a reeducation camp.void
setDescription
(String description) Sets the description of the academy.void
setEducationLevelMax
(EducationLevel educationLevelMax) Sets the maximum education level provided by the academy.void
setEducationLevelMin
(EducationLevel educationLevelMin) Sets the minimum education level required for admission.void
setFactionDiscount
(Integer factionDiscount) Sets the faction discount raw value.void
Sets the id of the academy.void
setIsMilitary
(boolean isMilitary) Sets the value indicating whether the academy is a military academy.void
setLocationSystems
(List<String> locationSystems) Sets the location systems for the academy.void
Sets the name of the academy.void
Sets the value of the set variable for academies.void
setTuition
(Integer tuition) Sets the tuition value.void
Sets the type of academy.static String
skillParser
(String skill) Parses a given skill string and returns the corresponding skill type.
-
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 academyname
- the name of the academytype
- 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 academyfactionDiscount
- the discount offered by the academy to faction membersisFactionRestricted
- 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 presentconstructionYear
- the year when the academy was constructeddestructionYear
- the year when the academy was destroyedtuition
- the tuition fee for attending the academydurationDays
- the duration of the academy in daysfacultySkill
- the skill level of the academy's facultyeducationLevelMin
- the minimum education level required to attend the academyeducationLevelMax
- the maximum education level provided by the academyageMin
- the minimum age requirement to attend the academyageMax
- the maximum age accepted by the academyqualifications
- the list of qualifications provided by the academycurriculums
- the list of curriculums offered by the academyqualificationStartYears
- the list of years when each qualification becomes availablebaseAcademicSkillLevel
- the base skill level provided by the academyid
- the id number of the academy, used for sorting academies in mhq
-
-
Method Details
-
getSet
Retrieves the value of the "set" property for academies.- Returns:
- The value of the "set" property.
-
setSet
Sets the value of the set variable for academies.- Parameters:
set
- the value to be assigned to the set variable
-
getName
Retrieves the name of the academy.- Returns:
- the name of the academy
-
setName
Sets the name of the academy.- Parameters:
name
- the new name to be set
-
getType
Gets the type of academy.- Returns:
- The type of academy.
-
setType
Sets the type of academy.- Parameters:
type
- the type to be set.
-
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
Checks if the academy is a Prep School.- Returns:
true
if the academy is a Prep School,false
otherwise.
-
isLocal
Checks if the academy is a local academy.- Returns:
true
if the academy is a local academy,false
otherwise.
-
isHomeSchool
- Returns:
true
if the academy is a home school,false
otherwise.
-
getDescription
Returns the description of the academy.- Returns:
- The description of the academy.
-
setDescription
Sets the description of the academy.- Parameters:
description
- the new description for the academy
-
getLocationSystems
Retrieves the list of location systems where the academy is present.- Returns:
- The list of location systems as a List of String.
-
setLocationSystems
Sets the location systems for the academy.- Parameters:
locationSystems
- the list of location systems to be set
-
getConstructionYear
Returns the academy's construction year.- Returns:
- the academy's construction year as an Integer value.
-
getDestructionYear
Retrieves the academy's destruction year.- Returns:
- The academy's destruction year, represented as an Integer.
-
getClosureYear
Retrieves the closure year of an academy.- Returns:
- The closure year as an Integer.
-
getAgeMin
Retrieves the minimum age allowed at the academy.- Returns:
- the minimum age allowed as an Integer.
-
getAgeMax
Retrieves the maximum age allowed at the academy.- Returns:
- the maximum age allowed as an Integer.
-
getTuition
Retrieves the value of the academy's tuition.- Returns:
- the academy's tuition value as an Integer.
-
setTuition
Sets the tuition value.- Parameters:
tuition
- the new tuition value to be set
-
getDurationDays
Retrieves course duration (in days).- Returns:
- The course duration in days as an Integer.
-
getFactionDiscount
Retrieves the academy's faction discount value.- Returns:
- The academy's discount value for the faction.
-
setFactionDiscount
Sets the faction discount raw value.- Parameters:
factionDiscount
- the faction discount to set
-
getFacultySkill
Retrieves faculty skill level.- Returns:
- The faculty skill level as an Integer.
-
getEducationLevelMin
Returns the minimum academic tier value.- Returns:
- The minimum academic tier value as an Integer.
-
setEducationLevelMin
Sets the minimum education level required for admission.- Parameters:
educationLevelMin
- the minimum education level required, as an Integer
-
setEducationLevelMax
Sets the maximum education level provided by the academy.- Parameters:
educationLevelMax
- the maximum education level to be set
-
getQualifications
Returns the list of qualification names.- Returns:
- the list of qualification names.
-
getCurriculums
Retrieves the skills improved by this academy.- Returns:
- The skills improved by this academy as a String.
-
getQualificationStartYears
Retrieves the skills improved by this academy.- Returns:
- The skills improved by this academy as a String.
-
getBaseAcademicSkillLevel
Retrieves the base skill level granted by this academy.- Returns:
- the base skill level granted by this academy as an Integer
-
getId
Retrieves the ID of the academy.- Returns:
- the ID of the academy
-
setId
Sets the id of the academy.- Parameters:
id
- The id to be set.
-
compareTo
Compares an academy with this one by priority: xp, edge and name. Used for sorting.- Specified by:
compareTo
in interfaceComparable<Academy>
- Parameters:
other
- academy to be compared- Returns:
- int used for sorting
-
getTuitionAdjusted
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
Calculates the adjusted faction discount for a given person in a campaign.- Parameters:
campaign
- the campaign the person belongs toperson
- the person receiving the discount- Returns:
- the faction discount as a double value, between 0.00 and 1.00
-
getFilteredFaction
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
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
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
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
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
Returns the nearest campus to a given campaign.- Parameters:
campaign
- the campaign for which to find the nearest campuscampuses
- 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
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
-