Package megamek.common.options
Record Class QuirkPlaceholder
java.lang.Object
java.lang.Record
megamek.common.options.QuirkPlaceholder
- Record Components:
key- a stable lower_snake_case key, chosen to match the natural option name a future implementation would usegroupKey- the quirk group the placeholder belongs in, eitherQuirks.POS_QUIRKSorQuirks.NEG_QUIRKS; the UI lists it in that columnrulesBook- the abbreviated rule book the quirk is printed in (e.g."CO")rulesPage- the page in that book, as printed
public record QuirkPlaceholder(String key, String groupKey, String rulesBook, String rulesPage)
extends Record
A quirk that exists in the rule books but has no MegaMek option at all.
Unlike a QuirkCatalogEntry, a placeholder has no IOption behind it: it cannot be set on a unit,
never serializes into a saved game or MUL file, and never reaches MekHQ. It exists so the quirks UI can list the
book quirk as a grayed-out, searchable row - telling the player the quirk is missing rather than leaving them to
wonder where it went.
Keeping placeholders out of Quirks and WeaponQuirks is what makes them free of side effects. Do
not "promote" one by adding it here and to the option list; when a quirk is implemented, delete its placeholder and
give the new option a .working resource entry instead.
-
Constructor Summary
ConstructorsConstructorDescriptionQuirkPlaceholder(String key, String groupKey, String rulesBook, String rulesPage) Creates an instance of aQuirkPlaceholderrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.groupKey()Returns the value of thegroupKeyrecord component.final inthashCode()Returns a hash code value for this object.key()Returns the value of thekeyrecord component.Returns the value of therulesBookrecord component.Returns the value of therulesPagerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Method Details
-
getDisplayableName
- Returns:
- the localized display name of the missing quirk
-
getDescription
- Returns:
- the localized one-line summary of the quirk's book effect
-
getRulesReference
- Returns:
- the localized "Book p.Page" citation for this quirk
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
key
Returns the value of thekeyrecord component.- Returns:
- the value of the
keyrecord component
-
groupKey
Returns the value of thegroupKeyrecord component.- Returns:
- the value of the
groupKeyrecord component
-
rulesBook
Returns the value of therulesBookrecord component.- Returns:
- the value of the
rulesBookrecord component
-
rulesPage
Returns the value of therulesPagerecord component.- Returns:
- the value of the
rulesPagerecord component
-