Enum Class Ambition

java.lang.Object
java.lang.Enum<Ambition>
mekhq.campaign.randomEvents.personalities.Ambition
All Implemented Interfaces:
Serializable, Comparable<Ambition>, Constable, PersonalityTrait

public enum Ambition extends Enum<Ambition> implements PersonalityTrait
Represents various levels and traits of ambition in a personality.

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.

  • Enum Constant Details

    • NONE

      public static final Ambition NONE
    • AMBITIOUS

      public static final Ambition AMBITIOUS
    • ARROGANT

      public static final Ambition ARROGANT
    • ASPIRING

      public static final Ambition ASPIRING
    • CALCULATING

      public static final Ambition CALCULATING
    • CONNIVING

      public static final Ambition CONNIVING
    • CONTROLLING

      public static final Ambition CONTROLLING
    • CUTTHROAT

      public static final Ambition CUTTHROAT
    • DILIGENT

      public static final Ambition DILIGENT
    • DRIVEN

      public static final Ambition DRIVEN
    • ENERGETIC

      public static final Ambition ENERGETIC
    • EXCESSIVE

      public static final Ambition EXCESSIVE
    • FOCUSED

      public static final Ambition FOCUSED
    • GOAL_ORIENTED

      public static final Ambition GOAL_ORIENTED
    • MOTIVATED

      public static final Ambition MOTIVATED
    • OPPORTUNISTIC

      public static final Ambition OPPORTUNISTIC
    • OVERCONFIDENT

      public static final Ambition OVERCONFIDENT
    • PERSISTENT

      public static final Ambition PERSISTENT
    • PROACTIVE

      public static final Ambition PROACTIVE
    • RESILIENT

      public static final Ambition RESILIENT
    • RUTHLESS

      public static final Ambition RUTHLESS
    • SELFISH

      public static final Ambition SELFISH
    • STRATEGIC

      public static final Ambition STRATEGIC
    • UNAMBITIOUS

      public static final Ambition UNAMBITIOUS
    • UNSCRUPULOUS

      public static final Ambition UNSCRUPULOUS
    • DISHONEST

      public static final Ambition DISHONEST
    • INNOVATIVE

      public static final Ambition INNOVATIVE
    • MANIPULATIVE

      public static final Ambition MANIPULATIVE
    • RESOURCEFUL

      public static final Ambition RESOURCEFUL
    • TYRANNICAL

      public static final Ambition TYRANNICAL
    • VISIONARY

      public static final Ambition VISIONARY
  • Field Details

    • MAXIMUM_VARIATIONS

      public static final int MAXIMUM_VARIATIONS
      Defines the number of individual description variants available for each trait.
      See Also:
    • MAJOR_TRAITS_START_INDEX

      public static final int MAJOR_TRAITS_START_INDEX
      The index at which major traits begin within the enumeration.
      See Also:
  • Method Details

    • values

      public static Ambition[] 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

      public static Ambition valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • getPersonalityTraitType

      public PersonalityTraitType getPersonalityTraitType()
      Returns:
      the PersonalityTraitType representing ambition
      Since:
      0.50.06
    • getPersonalityTraitTypeLabel

      @Deprecated(since="0.51.0", forRemoval=true) public String 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

      public String 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 - the Gender of 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

      public String getRoninMessage(String commanderAddress)
      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

      public String getInterviewersNotes(int ambitionDescriptionIndex)
      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:
      isTraitPositive in interface PersonalityTrait
      Returns:
      true if the personality trait is considered positive, false otherwise.
    • isTraitMajor

      public boolean isTraitMajor()
      Specified by:
      isTraitMajor in interface PersonalityTrait
      Returns:
      true if the personality trait is considered a major trait, false otherwise.
    • isNone

      public boolean isNone()
      Specified by:
      isNone in interface PersonalityTrait
      Returns:
      true if the personality trait is neutral, false otherwise.
    • fromString

      public static Ambition fromString(String text)
      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 value NONE.
      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

      public String toString()
      Overrides:
      toString in class Enum<Ambition>