Record Class QuirkCatalogEntry

java.lang.Object
java.lang.Record
megamek.common.options.QuirkCatalogEntry
Record Components:
kind - whether this is a chassis quirk or a weapon quirk. Needed to identify the quirk, because fast_reload and mod_weapons each name both a chassis and a weapon quirk.
code - the quirk's IOption name (an OptionsConstants QUIRK_ value)
status - how completely MegaMek implements the quirk
rulesBook - the abbreviated rule book the quirk is printed in (e.g. "BMM"), or null when the bundle carries no reference for it
rulesPage - the page in that book, as printed, or null when the bundle carries no reference

public record QuirkCatalogEntry(QuirkKind kind, String code, QuirkImplementationStatus status, String rulesBook, String rulesPage) extends Record
One real quirk option in the QuirkCatalog: how completely MegaMek implements it and where its rule is printed.

This record is static reference data assembled from the resource bundle at class load. It is never part of a serialized object graph (saved games, MUL files), so it deliberately has no SerializationHelper converter - do not add it to a serialized class without one.

  • Constructor Details

  • Method Details

    • getRulesReference

      @Nullable public String getRulesReference()
      Returns:
      the localized "Book p.Page" citation for this quirk, or null when the bundle carries no rules reference for it
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • kind

      public QuirkKind kind()
      Returns the value of the kind record component.
      Returns:
      the value of the kind record component
    • code

      public String code()
      Returns the value of the code record component.
      Returns:
      the value of the code record component
    • status

      public QuirkImplementationStatus status()
      Returns the value of the status record component.
      Returns:
      the value of the status record component
    • rulesBook

      @Nullable public String rulesBook()
      Returns the value of the rulesBook record component.
      Returns:
      the value of the rulesBook record component
    • rulesPage

      @Nullable public String rulesPage()
      Returns the value of the rulesPage record component.
      Returns:
      the value of the rulesPage record component