Enum Class QuirkKind

java.lang.Object
java.lang.Enum<QuirkKind>
megamek.common.options.QuirkKind
All Implemented Interfaces:
Serializable, Comparable<QuirkKind>, Constable

public enum QuirkKind extends Enum<QuirkKind>
Which of MegaMek's two quirk option sets a quirk belongs to: the chassis quirks held by the unit (Quirks) or the per-weapon quirks held by each mount (WeaponQuirks).

This is not a cosmetic distinction. The two sets share several option codes - fast_reload and mod_weapons each name both a chassis quirk and a weapon quirk - so a quirk is only uniquely identified by its kind together with its code. Each kind also names its own resource bundle prefix, which is how QuirkCatalog finds a quirk's implementation status and rules reference.

  • Enum Constant Details

    • UNIT

      public static final QuirkKind UNIT
      A chassis quirk, registered in Quirks and held by the unit as a whole.
    • WEAPON

      public static final QuirkKind WEAPON
      A weapon quirk, registered in WeaponQuirks and held by an individual weapon mount.
  • Method Details

    • values

      public static QuirkKind[] 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 QuirkKind 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
    • resourceKey

      public String resourceKey(String code, String suffix)
      Parameters:
      code - the quirk's option name (an OptionsConstants QUIRK_ value)
      suffix - the metadata key suffix, without its leading dot (for example "working")
      Returns:
      the full resource key for that piece of quirk metadata, in the megamek.common.options.messages bundle