Record Class WorldInspection

java.lang.Object
java.lang.Record
forgottentowns.mod.api.WorldInspection
Record Components:
units - whether citizens, soldiers, heroes, and creatures can be inspected
zones - whether zones expose inspection and their available construction tools
sampleBuildables - whether middle-click selects an unlocked structural construction tool

public record WorldInspection(boolean units, boolean zones, boolean sampleBuildables) extends Record
Opts into the host's dedicated middle-click inspectors. The host owns picking, localized presentation, unlock checks, equipment requests and world-tool selection. Unit inspection also routes roster information buttons to the same dedicated inspector. Registrations are additive; disabling the owning mod removes its opt-in on restart.
  • Constructor Summary

    Constructors
    Constructor
    Description
    WorldInspection(boolean units, boolean zones)
    Creates inspection options without enabling construction sampling.
    WorldInspection(boolean units, boolean zones, boolean sampleBuildables)
    Creates an instance of a WorldInspection record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    boolean
    Returns the value of the sampleBuildables record component.
    final String
    Returns a string representation of this record class.
    boolean
    Returns the value of the units record component.
    boolean
    Returns the value of the zones record component.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • WorldInspection

      public WorldInspection(boolean units, boolean zones)
      Creates inspection options without enabling construction sampling.
      Parameters:
      units - whether units can be inspected
      zones - whether zones can be inspected
    • WorldInspection

      public WorldInspection(boolean units, boolean zones, boolean sampleBuildables)
      Creates an instance of a WorldInspection record class.
      Parameters:
      units - the value for the units record component
      zones - the value for the zones record component
      sampleBuildables - the value for the sampleBuildables record component
  • Method Details

    • 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 '=='.
      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.
    • units

      public boolean units()
      Returns the value of the units record component.
      Returns:
      the value of the units record component
    • zones

      public boolean zones()
      Returns the value of the zones record component.
      Returns:
      the value of the zones record component
    • sampleBuildables

      public boolean sampleBuildables()
      Returns the value of the sampleBuildables record component.
      Returns:
      the value of the sampleBuildables record component