Enum Class Ambition
- All Implemented Interfaces:
Serializable,Comparable<Ambition>,Constable,PersonalityTrait
This enumeration defines a wide range of traits that can be associated with a person's personality. Traits are characterized as either "positive" or not and can optionally be "major" traits. The enumeration also handles metadata such as retrieving localized labels and descriptions.
Some traits, referred to as "Major Traits," denote stronger personality attributes and are to be handled distinctly. These traits are always listed at the end of the enumeration.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescription -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe index at which major traits begin within the enumeration.static final intDefines the number of individual description variants available for each trait. -
Method Summary
Modifier and TypeMethodDescriptionstatic AmbitionfromString(String text) Converts the specified string into its corresponding Ambition enum value.getDescription(int ambitionDescriptionIndex, megamek.common.enums.Gender gender, String givenName) Generates a localized and personalized description for the current enumeration value.getInterviewersNotes(int ambitionDescriptionIndex) Retrieves the formatted interviewer notes for a specific ambition description index.getLabel()Deprecated, for removal: This API element is subject to removal in a future version.getRoninMessage(String commanderAddress) Retrieves the message displayed when a Ronin warrior expresses interest in joining the campaign.booleanisNone()booleanbooleantoString()static AmbitionReturns the enum constant of this class with the specified name.static Ambition[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
NONE
-
AMBITIOUS
-
ARROGANT
-
ASPIRING
-
CALCULATING
-
CONNIVING
-
CONTROLLING
-
CUTTHROAT
-
DILIGENT
-
DRIVEN
-
ENERGETIC
-
EXCESSIVE
-
FOCUSED
-
GOAL_ORIENTED
-
MOTIVATED
-
OPPORTUNISTIC
-
OVERCONFIDENT
-
PERSISTENT
-
PROACTIVE
-
RESILIENT
-
RUTHLESS
-
SELFISH
-
STRATEGIC
-
UNAMBITIOUS
-
UNSCRUPULOUS
-
DISHONEST
-
INNOVATIVE
-
MANIPULATIVE
-
RESOURCEFUL
-
TYRANNICAL
-
VISIONARY
-
-
Field Details
-
MAXIMUM_VARIATIONS
public static final int MAXIMUM_VARIATIONSDefines the number of individual description variants available for each trait.- See Also:
-
MAJOR_TRAITS_START_INDEX
public static final int MAJOR_TRAITS_START_INDEXThe index at which major traits begin within the enumeration.- See Also:
-
-
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
-
getPersonalityTraitType
- Returns:
- the
PersonalityTraitTyperepresenting ambition - Since:
- 0.50.06
-
getPersonalityTraitTypeLabel
Deprecated, for removal: This API element is subject to removal in a future version.- Returns:
- the label string for the ambition personality trait type
- Since:
- 0.50.06
-
getLabel
-
getDescription
public String getDescription(int ambitionDescriptionIndex, megamek.common.enums.Gender gender, String givenName) Generates a localized and personalized description for the current enumeration value.This method retrieves a description using the enumeration's name and a specific key suffix derived from the given ambition description index. The description is further customized using the provided gender-specific pronouns, the individual's given name, and other localized text from the resource bundle.
- Parameters:
ambitionDescriptionIndex- an index representing the type/variation of the description. This value is clamped to ensure it falls within a valid range.gender- theGenderof the individual, used to determine appropriate pronouns for the description.givenName- the given name of the person. This MUST use 'person.getGivenName()' and NOT 'person.getFirstName()'- Returns:
- a formatted description string based on the enum, the individual's gender, name, and aggression description index.
-
getRoninMessage
Retrieves the message displayed when a Ronin warrior expresses interest in joining the campaign.This method formats a message using a resource key derived from the current object and includes the commander's address as part of the message formatting.
- Parameters:
commanderAddress- the address or name of the commander to include in the message.- Returns:
- the formatted Ronin message as a
String.
-
getInterviewersNotes
Retrieves the formatted interviewer notes for a specific ambition description index.Constructs a resource key by combining the enum name, "interviewerNote", and the provided index, then fetches the formatted text for that key from the resource bundle.
- Parameters:
ambitionDescriptionIndex- the index of the ambition description to retrieve notes for- Returns:
- the formatted interviewer notes text corresponding to the specified index.
- Since:
- 0.50.06
-
isTraitPositive
public boolean isTraitPositive()- Specified by:
isTraitPositivein interfacePersonalityTrait- Returns:
trueif the personality trait is considered positive,falseotherwise.
-
isTraitMajor
public boolean isTraitMajor()- Specified by:
isTraitMajorin interfacePersonalityTrait- Returns:
trueif the personality trait is considered a major trait,falseotherwise.
-
isNone
public boolean isNone()- Specified by:
isNonein interfacePersonalityTrait- Returns:
trueif the personality trait is neutral,falseotherwise.
-
fromString
Converts the specified string into its corresponding Ambition enum value. The method attempts to interpret the string as either the name of an enum constant or an ordinal value of the enum. If the conversion fails, the method logs an error and returns the default valueNONE.- Parameters:
text- the string to be converted into an Ambition enum value. It can be the name of the enum constant or its ordinal value as a string.- Returns:
- the corresponding Ambition enum constant if the string matches a name or ordinal value, otherwise
NONE.
-
toString
-