Enum Class PersonnelRole
- All Implemented Interfaces:
Serializable
,Comparable<PersonnelRole>
,Constable
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionIndividual roles with corresponding name texts and mnemonics. -
Method Summary
Modifier and TypeMethodDescriptionstatic PersonnelRole
fromString
(String text) Converts a given string into aPersonnelRole
.static List<PersonnelRole>
int
getAttributeModifier
(SkillAttribute attribute) Retrieves the corresponding modifier value for the givenSkillAttribute
.static int
static List<PersonnelRole>
Returns a list ofPersonnelRole
instances that are of the subtypeCIVILIAN
.static List<PersonnelRole>
Returns a list ofPersonnelRole
instances that are of the subtypeCIVILIAN
, excluding theNONE
role.static List<PersonnelRole>
Deprecated, for removal: This API element is subject to removal in a future version.getDescription
(boolean isClan) Retrieves the plain text description for this personnel role from the resource bundle.getLabel
(boolean isClan) Retrieves the label for this instance, optionally using a clan-specific label if applicable.static List<PersonnelRole>
int
static List<PersonnelRole>
getSkillsForProfession
(boolean isAdminsHaveNegotiation, boolean isDoctorsUseAdministration, boolean isTechsUseAdministration, boolean isUseArtillery) Retrieves the list of skill names relevant to this profession, tailored according to provided campaign or generation options.static List<PersonnelRole>
static List<PersonnelRole>
Deprecated, for removal: This API element is subject to removal in a future version.usegetTooltip(boolean)
insteadgetTooltip
(boolean isClan) Builds an HTML tooltip string providing a description of this personnel role and a list of related skills with their linked attributes, if available.static PersonnelRole[]
getValuesSortedAlphabetically
(boolean clanCampaign) Returns an array of allPersonnelRole
values sorted alphabetically by their display label.static List<PersonnelRole>
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
Determines if the current entity is an assistant by checking if it is either an Astech or a Medic.boolean
isAstech()
boolean
isBATech()
boolean
boolean
boolean
isCombat()
boolean
boolean
boolean
isDoctor()
boolean
boolean
boolean
boolean
boolean
isMedic()
boolean
boolean
boolean
boolean
boolean
boolean
boolean
isNone()
boolean
boolean
boolean
boolean
isSubType
(PersonnelRoleSubType subType) Checks if this object's subtype matches the specifiedPersonnelRoleSubType
.boolean
boolean
isSupport
(boolean excludeCivilian) boolean
isTech()
Checks whether a character is assigned to a technician role.boolean
Checks whether a character is assigned to a technician role.boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
toString()
This method is not recommended to be used in MekHQ, but is provided for non-specified utilizationstatic PersonnelRole
Returns the enum constant of this class with the specified name.static PersonnelRole[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
MEKWARRIOR
Individual roles with corresponding name texts and mnemonics. -
LAM_PILOT
-
GROUND_VEHICLE_DRIVER
-
NAVAL_VEHICLE_DRIVER
-
VTOL_PILOT
-
VEHICLE_GUNNER
-
VEHICLE_CREW
-
AEROSPACE_PILOT
-
CONVENTIONAL_AIRCRAFT_PILOT
-
PROTOMEK_PILOT
-
BATTLE_ARMOUR
-
SOLDIER
-
VESSEL_PILOT
-
VESSEL_GUNNER
-
VESSEL_CREW
-
VESSEL_NAVIGATOR
-
MEK_TECH
-
MECHANIC
-
AERO_TEK
-
BA_TECH
-
ASTECH
-
DOCTOR
-
MEDIC
-
ADMINISTRATOR_COMMAND
-
ADMINISTRATOR_LOGISTICS
-
ADMINISTRATOR_TRANSPORT
-
ADMINISTRATOR_HR
-
NONE
-
DEPENDENT
-
ADULT_ENTERTAINER
-
ANTIQUARIAN
-
SPORTS_STAR
-
ASTROGRAPHER
-
BARBER
-
BARTENDER
-
WAR_CORRESPONDENT
-
BRAWLER
-
BROKER
-
CHEF
-
CIVILIAN_AERO_MECHANIC
-
CIVILIAN_DROPSHIP_PILOT
-
POLICE_OFFICER
-
CIVILIAN_VTOL_PILOT
-
CIVIL_CLERK
-
CLOWN
-
CON_ARTIST
-
MILITARY_CORONER
-
COURIER
-
CRIMINAL_MECHANIC
-
CULTURAL_CENSOR
-
CULTURAL_LIAISON
-
CUSTOMS_INSPECTOR
-
DATA_SMUGGLER
-
DATA_ANALYST
-
SPACEPORT_WORKER
-
DRUG_DEALER
-
FACTORY_WORKER
-
LIVESTOCK_FARMER
-
AGRI_FARMER
-
FIREFIGHTER
-
FISHER
-
COUNTERFEITER
-
GAMBLER
-
CIVILIAN_DOCTOR
-
HACKER
-
HERALD
-
HISTORIAN
-
HOLO_CARTOGRAPHER
-
HOLO_GAMER
-
HOLO_JOURNALIST
-
HOLO_STAR
-
INDUSTRIAL_MEK_PILOT
-
INFORMATION_BROKER
-
MILITARY_LIAISON
-
JANITOR
-
JUMPSHIP_CHEF
-
EXOSKELETON_LABORER
-
LAWYER
-
PROPHET
-
RELIC_HUNTER
-
MEDIATOR
-
MEDICAL_RESEARCHER
-
MEK_RANGE_INSTRUCTOR
-
MERCHANT
-
MILITARY_ACCOUNTANT
-
MILITARY_ANALYST
-
SPY
-
MILITARY_THEORIST
-
MINER
-
MOUNTAIN_CLIMBER
-
FACTORY_FOREMAN
-
MUNITIONS_FACTORY_WORKER
-
MUSICIAN
-
ORBITAL_DEFENSE_GUNNER
-
ORBITAL_SHUTTLE_PILOT
-
PARAMEDIC
-
PAINTER
-
PATHFINDER
-
PERFORMER
-
PERSONAL_VALET
-
ESCAPED_PRISONER
-
PROPAGANDIST
-
PSYCHOLOGIST
-
FIRING_RANGE_SAFETY_OFFICER
-
RECRUITMENT_SCREENING_OFFICER
-
RELIGIOUS_LEADER
-
REPAIR_BAY_SUPERVISOR
-
REVOLUTIONIST
-
RITUALIST
-
SALVAGE_RAT
-
SCRIBE
-
SCULPTURER
-
SENSOR_TECHNICIAN
-
CIVILIAN_PILOT
-
STREET_SURGEON
-
SWIMMING_INSTRUCTOR
-
TACTICAL_ANALYST
-
TAILOR
-
TEACHER
-
TECH_COMMUNICATIONS
-
TECH_ZERO_G
-
TECH_HYDROPONICS
-
TECH_FUSION_PLANT
-
TECH_SECURITY
-
TECH_WASTE_MANAGEMENT
-
TECH_WATER_RECLAMATION
-
THIEF
-
BURGLAR
-
TRAINING_SIM_OPERATOR
-
TRANSPORT_DRIVER
-
ARTIST
-
WAREHOUSE_WORKER
-
WARFARE_PLANNER
-
WEATHERCASTER
-
XENOANIMAL_TRAINER
-
XENO_BIOLOGIST
-
GENETICIST
-
MASSEUSE
-
BODYGUARD
-
ARTISAN_MICROBREWER
-
INTERSTELLAR_TOURISM_GUIDE
-
CORPORATE_CONCIERGE
-
VIRTUAL_REALITY_THERAPIST
-
EXOTIC_PET_CARETAKER
-
CULTURAL_SENSITIVITY_ADVISOR
-
PLANETARY_IMMIGRATION_ASSESSOR
-
PERSONAL_ASSISTANT
-
PENNILESS_NOBLE
-
AIDE_DE_CAMP
-
NEUROHELMET_INTERFACE_CALIBRATOR
-
CIVILIAN_AEROSPACE_INSTRUCTOR
-
CIVILIAN_JUMPSHIP_NAVIGATOR
-
POLITICAL_AGITATOR
-
NOBLE_STEWARD
-
BATTLE_ROM_EDITOR
-
LUXURY_COMPANION
-
PLANETARY_SURVEYOR
-
DISGRACED_NOBLE
-
SPACEPORT_BUREAUCRAT
-
VR_ENTERTAINER
-
PERSONAL_ARCHIVIST
-
INDUSTRIAL_INSPECTOR
-
SPACEPORT_COURIER
-
MEKBAY_SCHEDULER
-
MILITARY_CONTRACTOR
-
MILITARY_HOLO_FILMER
-
WEAPONS_TESTER
-
PARAMILITARY_TRAINER
-
MILITIA_LEADER
-
FIELD_HOSPITAL_ADMINISTRATOR
-
CIVILIAN_REQUISITION_OFFICER
-
TRAINING_SIM_DESIGNER
-
COMMS_OPERATOR
-
DECOMMISSIONING_SPECIALIST
-
WAR_CRIME_INVESTIGATOR
-
SECURITY_ADVISOR
-
MILITARY_RECRUITER
-
MILITARY_PONY_EXPRESS_COURIER
-
MILITARY_PAINTER
-
MORALE_OFFICER
-
COMBAT_CHAPLAIN
-
LOGISTICS_COORDINATOR
-
FOOD_TRUCK_OPERATOR
-
MESS_HALL_MANAGER
-
CIVILIAN_LIAISON
-
FIELD_LAUNDRY_OPERATOR
-
MUNITIONS_CLERK
-
SECURITY_DESK_OPERATOR
-
ARMS_DEALER
-
DATA_LAUNDERER
-
UNLICENSED_CHEMIST
-
SMUGGLER
-
PROTECTION_RACKETEER
-
THUG
-
GANG_LEADER
-
PRISON_FIXER
-
TORTURER
-
INTELLIGENCE_ANALYST
-
CODEBREAKER
-
COUNTERINTELLIGENCE_LIAISON
-
DATA_INTERCEPT_OPERATOR
-
SURVEILLANCE_EXPERT
-
TECH_ENCRYPTION
-
DEEP_COVER_OPERATIVE
-
INTERROGATOR
-
DATA_HARVESTER
-
SIGNAL_JAMMING_SPECIALIST
-
CORPORATE_ESPIONAGE_AGENT
-
LOYALTY_MONITOR
-
MEDIA_MANIPULATOR
-
CIVILIAN_DEBRIEFER
-
SPACEPORT_ENGINEER
-
FRONTIER_DOCTOR
-
DOOMSDAY_PREACHER
-
TAX_AUDITOR
-
MARKET_MANIPULATOR
-
SUBVERSIVE_POET
-
LEGAL_ARCHIVIST
-
CONFLICT_RESOLUTION_TRAINER
-
DUELIST
-
SCANDAL_FIXER
-
RELATIONSHIP_MATCHMAKER
-
PRISON_GUARD
-
GENETIC_THERAPY_SPECIALIST
-
IMPLANT_SURGEON
-
DISEASE_CONTROL_ADMINISTRATOR
-
TRAUMA_COUNSELOR
-
ORGAN_HARVESTER
-
PHYSICAL_REHABILITATION_THERAPIST
-
SURGICAL_SIMULATOR_INSTRUCTOR
-
COMBAT_PROSTHETICS_FITTER
-
PLANETARY_ADAPTATION_PHYSIOLOGIST
-
ZERO_G_PHYSICAL_THERAPIST
-
ORBITAL_DEBRIS_TRACKER
-
PUBLIC_TRANSPORT_OVERSEER
-
MILITARY_PROMOTER
-
AEROSPACE_SCAVENGER
-
MYTHOLOGIST
-
GRAFFITI_ARTIST
-
PSYOPS_BROADCASTER
-
WEDDING_PLANNER
-
FREIGHT_LIFT_OPERATOR
-
REEDUCATION_SPECIALIST
-
GUILD_LIAISON
-
ILLEGAL_PET_SMUGGLER
-
HOLO_DJ
-
CLAIMS_ARBITRATOR
-
LIVESTREAM_ENTERTAINER
-
MILITARY_TATTOO_ARTIST
-
RATION_DISTRIBUTOR
-
MINEFIELD_PLANNER
-
CARGO_SEAL_INSPECTOR
-
INTERIOR_DECORATOR
-
RIOT_RESPONSE_PLANNER
-
SYSTEMS_CONSULTANT
-
TECH_AIR_FILTRATION
-
EARLY_DETECTION_SYSTEMS_OPERATOR
-
CIVIC_CONTROLLER
-
PUBLIC_EXECUTION_BROADCASTER
-
IDENTITY_FABRICATOR
-
NOBLE_HEIR_IN_HIDING
-
PERSONAL_SOMMELIER
-
PHILOSOPHER
-
MILITARY_ACADEMY_DROPOUT
-
ASTECH_TRAINER
-
NOBLE_PAGE
-
FALSE_PROPHET
-
CULTIST
-
LIBRARIAN
-
BANQUET_PLANNER
-
COMMUNITY_LEADER
-
LOREKEEPER
-
ELECTION_FIXER
-
SURVEILLANCE_SWEEPER
-
LOYALTY_AUDITOR
-
DATA_LEAK_TRACKER
-
PROFESSIONAL_COSPLAYER
-
PLANETARY_MIGRATION_COORDINATOR
-
RADIATION_RISK_MONITOR
-
DROPSHIP_ENTERTAINMENT_OFFICER
-
JUMPSHIP_BOTANIST
-
LOCAL_WARLORD
-
MISCELLANEOUS_JOB
-
NOBLE
-
COMMON_CRIMINAL
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
getLabel
Retrieves the label for this instance, optionally using a clan-specific label if applicable.This method generates a label based on a specific resource bundle key. If the specified option to use a clan label is enabled and a clan name is available, it retrieves the clan-specific label. Otherwise, it retrieves the standard label.
- Parameters:
isClan
- A flag indicating whether to use the clan-specific label. Iftrue
and the instance has a clan name, the clan-specific label will be used.- Returns:
- The formatted label string, either clan-specific or standard, based on the provided flag and availability.
- Since:
- 0.50.05
-
getDescription
Deprecated, for removal: This API element is subject to removal in a future version.usegetTooltip(boolean)
instead -
getDescription
Retrieves the plain text description for this personnel role from the resource bundle.- Returns:
- the description string associated with the personnel role.
- Since:
- 0.50.06
-
getTooltip
Deprecated, for removal: This API element is subject to removal in a future version.usegetTooltip(boolean)
instead -
getTooltip
Builds an HTML tooltip string providing a description of this personnel role and a list of related skills with their linked attributes, if available.If the list of skills for this profession is not empty, the tooltip will include each skill followed by its relevant
SkillAttribute
types. Otherwise, a default formatted description is returned from the resource bundle.- Returns:
- an HTML-formatted tooltip string detailing the profession and corresponding skills.
- Since:
- 0.50.06
-
getMnemonic
public int getMnemonic() -
getAttributeModifier
Retrieves the corresponding modifier value for the givenSkillAttribute
.This method determines the modifier by matching the input
SkillAttribute
to its associated property within the class. The mapping is as follows:SkillAttribute.NONE
: Returns0
as no modification is applicable.SkillAttribute.STRENGTH
: Returns the value of thestrength
modifier.SkillAttribute.BODY
: Returns the value of thebody
modifier.SkillAttribute.REFLEXES
: Returns the value of thereflexes
modifier.SkillAttribute.DEXTERITY
: Returns the value of thedexterity
modifier.SkillAttribute.INTELLIGENCE
: Returns the value of theintelligence
modifier.SkillAttribute.WILLPOWER
: Returns the value of thewillpower
modifier.SkillAttribute.CHARISMA
: Returns the value of thecharisma
modifier.
- Parameters:
attribute
- TheSkillAttribute
for which the modifier value is requested. Must not benull
.- Returns:
- The integer value of the modifier corresponding to the given
SkillAttribute
.
-
getSkillsForProfession
- Returns:
- a list of skill names representing the profession-appropriate skills
- See Also:
-
getSkillsForProfession
public List<String> getSkillsForProfession(boolean isAdminsHaveNegotiation, boolean isDoctorsUseAdministration, boolean isTechsUseAdministration, boolean isUseArtillery) Retrieves the list of skill names relevant to this profession, tailored according to provided campaign or generation options.The set of returned skills may vary depending on input flags that define whether certain support or specialty skills (such as Negotiation, Administration, or Artillery) should be included for appropriate roles.
This method is typically used during personnel creation or skill assignment to ensure each role receives a fitting skill set based on campaign rules and user preferences.
- Parameters:
isAdminsHaveNegotiation
- iftrue
, includes Negotiation skill for administratorsisDoctorsUseAdministration
- iftrue
, includes Administration skill for medical rolesisTechsUseAdministration
- iftrue
, includes Administration skill for technical rolesisUseArtillery
- iftrue
, includes Artillery skills where applicable- Returns:
- a list of skill names representing the profession-appropriate skills
-
isMekWarrior
public boolean isMekWarrior()- Returns:
true
if the personnel has the Mek Warrior role,false
otherwise.
-
isLAMPilot
public boolean isLAMPilot()- Returns:
true
if the personnel has the LAM Pilot role,false
otherwise.
-
isGroundVehicleDriver
public boolean isGroundVehicleDriver()- Returns:
true
if the personnel has the Ground Vehicle Driver role,false
otherwise.
-
isVTOLPilot
public boolean isVTOLPilot()- Returns:
true
if the personnel has the VTOL Pilot role,false
otherwise.
-
isVehicleGunner
public boolean isVehicleGunner()- Returns:
true
if the personnel has the Vehicle Gunner role,false
otherwise.
-
isVehicleCrew
public boolean isVehicleCrew()- Returns:
true
if the personnel has the Vehicle Crew role,false
otherwise.
-
isAerospacePilot
public boolean isAerospacePilot()- Returns:
true
if the personnel has the Aerospace Pilot role,false
otherwise.
-
isConventionalAircraftPilot
public boolean isConventionalAircraftPilot()- Returns:
true
if the personnel has the Conventional Aircraft Pilot role,false
otherwise.
-
isProtoMekPilot
public boolean isProtoMekPilot()- Returns:
true
if the personnel has the ProtoMek Pilot role,false
otherwise.
-
isBattleArmour
public boolean isBattleArmour()- Returns:
true
if the personnel has the Battle Armor Pilot role,false
otherwise.
-
isSoldier
public boolean isSoldier()- Returns:
true
if the personnel has the Soldier role,false
otherwise.
-
isVesselPilot
public boolean isVesselPilot()- Returns:
true
if the personnel has the Vessel Pilot role,false
otherwise.
-
isVesselGunner
public boolean isVesselGunner()- Returns:
true
if the personnel has the Vessel Gunner role,false
otherwise.
-
isVesselCrew
public boolean isVesselCrew()- Returns:
true
if the personnel has the Vessel Crew role,false
otherwise.
-
isMekTech
public boolean isMekTech()- Returns:
true
if the personnel has the MekTech role,false
otherwise.
-
isMechanic
public boolean isMechanic()- Returns:
true
if the personnel has the Mechanic role,false
otherwise.
-
isAeroTek
public boolean isAeroTek()- Returns:
true
if the personnel has the AeroTek role,false
otherwise.
-
isBATech
public boolean isBATech()- Returns:
true
if the personnel has the Battle Armor Tech role,false
otherwise.
-
isAstech
public boolean isAstech()- Returns:
true
if the personnel has the Astech role,false
otherwise.
-
isDoctor
public boolean isDoctor()- Returns:
true
if the personnel has the Doctor role,false
otherwise.
-
isMedic
public boolean isMedic()- Returns:
true
if the personnel has the Medic role,false
otherwise.
-
isAdministratorCommand
public boolean isAdministratorCommand()- Returns:
true
if the personnel has the Admin/Command role,false
otherwise.
-
isAdministratorLogistics
public boolean isAdministratorLogistics()- Returns:
true
if the personnel has the Admin/Logistics role,false
otherwise.
-
isAdministratorTransport
public boolean isAdministratorTransport()- Returns:
true
if the personnel has the Admin/Transport role,false
otherwise.
-
isAdministratorHR
public boolean isAdministratorHR()- Returns:
true
if the personnel has the Admin/HR role,false
otherwise.
-
isDependent
public boolean isDependent()- Returns:
true
if the personnel has the Dependent role,false
otherwise.
-
isNone
public boolean isNone()- Returns:
true
if the personnel has the None role,false
otherwise.
-
isCombat
public boolean isCombat()- Returns:
true
if the character has a combat role,true
otherwise.
-
isSubType
Checks if this object's subtype matches the specifiedPersonnelRoleSubType
.- Parameters:
subType
- the subtype to compare against- Returns:
true
if this object's subtype is equal to the specified subtype;false
otherwise- Since:
- 0.50.06
-
isMekWarriorGrouping
public boolean isMekWarriorGrouping()- Returns:
true
if the character is a MekWarrior or a LAM Pilot,false
otherwise.
-
isAerospaceGrouping
public boolean isAerospaceGrouping()- Returns:
true
if the character is an Aerospace Pilot or a LAM Pilot,false
otherwise.
-
isGroundVehicleCrew
public boolean isGroundVehicleCrew()- Returns:
true
if the character is assigned to the Ground Vehicle Driver, Vehicle Gunner, or the Vehicle Crew role,false
otherwise.
-
isVTOLCrew
public boolean isVTOLCrew()- Returns:
true
if the character is assigned to the VTOL Pilot, Vehicle Gunner, or the Vehicle Crew role,false
otherwise.
-
isVehicleCrewMember
public boolean isVehicleCrewMember()- Returns:
true
if the character is assigned to the Ground Vehicle Crew, Naval Vehicle Crew, or the VTOL Pilot role,false
otherwise.
-
isSoldierOrBattleArmour
public boolean isSoldierOrBattleArmour()- Returns:
true
if the character is assigned to the Soldier, or the Battle Armor role,false
otherwise.
-
isVesselCrewMember
public boolean isVesselCrewMember()- Returns:
true
if the character is assigned to the Vessel Pilot, Vessel Gunner, Vessel Crew, or the Vessel Navigator role,false
otherwise.
-
isSupport
public boolean isSupport()- Returns:
true
if the character is assigned to a support role, excluding civilian roles,false
otherwise.
-
isSupport
public boolean isSupport(boolean excludeCivilian) - Parameters:
excludeCivilian
- whether to exclude civilian roles- Returns:
true
if the character is assigned to a support role,false
otherwise.
-
isTech
public boolean isTech()Checks whether a character is assigned to a technician role. If checking secondary roles,isTechSecondary
should be used.- Returns:
true
if the character is assigned to a technician role,false
otherwise.
-
isTechSecondary
public boolean isTechSecondary()Checks whether a character is assigned to a technician role. If checking primary roles,isTech
should be used.- Returns:
true
if the character is assigned to a technician role,false
otherwise.
-
isMedicalStaff
public boolean isMedicalStaff()- Returns:
true
if the character is assigned to a medical role,false
otherwise.
-
isAssistant
public boolean isAssistant()Determines if the current entity is an assistant by checking if it is either an Astech or a Medic.- Returns:
true
if the entity is an assistant (either an Astech or a Medic),false
otherwise.
-
isAdministrator
public boolean isAdministrator()- Returns:
true
if the character is assigned to an Administrative role,false
otherwise.
-
isCivilian
public boolean isCivilian()- Returns:
true
if the character's assigned role has a subtype ofPersonnelRoleSubType.CIVILIAN
,false
otherwise. This method no longer considers roles such asDEPENDENT
orNONE
as civilian roles, as in previous implementations.
-
getMarketableRoles
- Returns:
- a list of roles that can be included in the personnel market
-
getCombatRoles
- Returns:
- a list of personnel roles classified as combat roles.
-
getSupportRoles
- Returns:
- a list of personnel roles classified as support roles.
-
getCivilianRoles
Returns a list ofPersonnelRole
instances that are of the subtypeCIVILIAN
.- Returns:
- a
List<PersonnelRole>
containing all civilian personnel roles. - Since:
- 0.50.06
-
getCivilianRolesExceptNone
Returns a list ofPersonnelRole
instances that are of the subtypeCIVILIAN
, excluding theNONE
role.- Returns:
- a
List<PersonnelRole>
containing all civilian personnel roles exceptNONE
- Since:
- 0.50.06
-
getPrimaryRoles
- Returns:
- a list of roles that are potential primary roles. Currently, this is all bar NONE
-
getVesselRoles
- Returns:
- a list of roles that are considered to be vessel (as in spacecraft) crew members
-
getTechRoles
- Returns:
- a list of roles that are considered to be techs
-
getAdministratorRoles
- Returns:
- a list of all roles that are considered to be administrators
-
getCivilianCount
public static int getCivilianCount()- Returns:
- the number of civilian roles
-
fromString
Converts a given string into aPersonnelRole
.This method attempts to parse the input string into a
PersonnelRole
using a series of steps:- If the input is
null
or blank, the method logs an error and returnsNONE
. - Tries to parse the input as an enum name by converting it to uppercase and replacing spaces with underscores.
- Attempts to match the input string with the labels of available
PersonnelRole
values, both standard and clan-specific. - Includes compatibility handling for versions earlier than 50.1 with specific string mappings.
- Finally, tries to parse the input as an ordinal value of the enum.
- If all attempts fail, the method logs an error and returns
NONE
.
- Parameters:
text
- The input string to be converted into aPersonnelRole
.- Returns:
- The corresponding
PersonnelRole
if successfully parsed, orNONE
if parsing fails. - Since:
- 0.50.5
- If the input is
-
toString
This method is not recommended to be used in MekHQ, but is provided for non-specified utilization- Overrides:
toString
in classEnum<PersonnelRole>
- Returns:
- the base name of this role, without applying any overrides
-
getValuesSortedAlphabetically
Returns an array of allPersonnelRole
values sorted alphabetically by their display label.The sorting is performed based on the label returned by
getLabel(clanCampaign)
for each role, ensuring that the roles are ordered according to the user-facing names, which may differ depending on whether a clan campaign is in effect.- Parameters:
clanCampaign
-true
to use labels appropriate for a clan campaign;false
to use standard labels- Returns:
- a
PersonnelRole[]
containing all enum values sorted alphabetically by label - Since:
- 0.50.06
-
getTooltip(boolean)
instead