Record Class ColonyContext.Person

java.lang.Object
java.lang.Record
forgottentowns.mod.api.ColonyContext.Person
Record Components:
id - stable citizen identity
name - current player-visible name
female - female identity flag
living - alive and not deserting
civilian - ordinary civilian classification
soldier - soldier classification
hero - named hero classification
position - current tile, or null while absent
household - shared household key projected by a mod, or empty
needsBed - whether the citizen currently needs an individual bed
Enclosing interface:
ColonyContext

public static record ColonyContext.Person(int id, String name, boolean female, boolean living, boolean civilian, boolean soldier, boolean hero, ColonyContext.Position position, String household, boolean needsBed) extends Record
Immutable citizen identity and projected state.
  • Constructor Details

    • Person

      public Person(int id, String name, boolean female, boolean living, boolean civilian, boolean soldier, boolean hero, ColonyContext.Position position, String household, boolean needsBed)
      Creates an instance of a Person record class.
      Parameters:
      id - the value for the id record component
      name - the value for the name record component
      female - the value for the female record component
      living - the value for the living record component
      civilian - the value for the civilian record component
      soldier - the value for the soldier record component
      hero - the value for the hero record component
      position - the value for the position record component
      household - the value for the household record component
      needsBed - the value for the needsBed 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. Reference components are compared with Objects::equals(Object,Object); primitive components 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.
    • id

      public int id()
      Returns the value of the id record component.
      Returns:
      the value of the id record component
    • name

      public String name()
      Returns the value of the name record component.
      Returns:
      the value of the name record component
    • female

      public boolean female()
      Returns the value of the female record component.
      Returns:
      the value of the female record component
    • living

      public boolean living()
      Returns the value of the living record component.
      Returns:
      the value of the living record component
    • civilian

      public boolean civilian()
      Returns the value of the civilian record component.
      Returns:
      the value of the civilian record component
    • soldier

      public boolean soldier()
      Returns the value of the soldier record component.
      Returns:
      the value of the soldier record component
    • hero

      public boolean hero()
      Returns the value of the hero record component.
      Returns:
      the value of the hero record component
    • position

      public ColonyContext.Position position()
      Returns the value of the position record component.
      Returns:
      the value of the position record component
    • household

      public String household()
      Returns the value of the household record component.
      Returns:
      the value of the household record component
    • needsBed

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