Record Class ColonyContext.Modifiers

java.lang.Object
java.lang.Record
forgottentowns.mod.api.ColonyContext.Modifiers
Record Components:
canWork - whether autonomous work, military duties and promotion remain allowed
consumesFood - whether ordinary eating is needed; false maintains fed needs automatically
needsBed - whether an individual bed is required; false also maintains rest automatically
scale - multiplier for actor rendering, from 0.25 to 2
visualArchetype - existing visual archetype override, or empty
household - owning-mod namespaced household identity, or empty
preferredBed - stable bed ID, or zero for normal ownership assignment
statuses - localized entries shown on citizen and soldier rosters
permitsProfession - whether assigned professions and their benefits remain active
allAttributesBonus - additive bonus to each primary attribute, from 0 to 100
Enclosing interface:
ColonyContext

public static record ColonyContext.Modifiers(boolean canWork, boolean consumesFood, boolean needsBed, double scale, String visualArchetype, String household, long preferredBed, List<ColonyContext.Status> statuses, boolean permitsProfession, int allAttributesBonus) extends Record
Mod-owned citizen modifiers, recomputed on load; no effect stores live runtime objects.
  • Field Details

  • Constructor Details

    • Modifiers

      public Modifiers(boolean canWork, boolean consumesFood, boolean needsBed, double scale, String visualArchetype, String household, long preferredBed, List<ColonyContext.Status> statuses)
      Creates effects with ordinary professions and no attribute bonus.
      Parameters:
      canWork - permit work
      consumesFood - require ordinary eating
      needsBed - require own bed
      scale - visual multiplier
      visualArchetype - visual override
      household - household identity
      preferredBed - bed identity
      statuses - roster statuses
      Throws:
      IllegalArgumentException - if scale or bed ID is invalid or too many statuses are supplied
      NullPointerException - if a text value, the statuses list, or a status entry is null
    • Modifiers

      public Modifiers(boolean canWork, boolean consumesFood, boolean needsBed, double scale, String visualArchetype, String household, long preferredBed, List<ColonyContext.Status> statuses, boolean permitsProfession, int allAttributesBonus)
      Copies and validates bounded modifiers.
      Parameters:
      canWork - permit work
      consumesFood - require ordinary eating
      needsBed - require own bed
      scale - visual multiplier
      visualArchetype - visual override
      household - household identity
      preferredBed - bed identity
      statuses - roster statuses
      permitsProfession - permit profession effects
      allAttributesBonus - bonus to each primary attribute
      Throws:
      IllegalArgumentException - if scale, bed ID or bonus is invalid or more than eight statuses are supplied
      NullPointerException - if a text value, the statuses list, or a status entry is null
  • 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.
    • canWork

      public boolean canWork()
      Returns the value of the canWork record component.
      Returns:
      the value of the canWork record component
    • consumesFood

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

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

      public double scale()
      Returns the value of the scale record component.
      Returns:
      the value of the scale record component
    • visualArchetype

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

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

      public long preferredBed()
      Returns the value of the preferredBed record component.
      Returns:
      the value of the preferredBed record component
    • statuses

      public List<ColonyContext.Status> statuses()
      Returns the value of the statuses record component.
      Returns:
      the value of the statuses record component
    • permitsProfession

      public boolean permitsProfession()
      Returns the value of the permitsProfession record component.
      Returns:
      the value of the permitsProfession record component
    • allAttributesBonus

      public int allAttributesBonus()
      Returns the value of the allAttributesBonus record component.
      Returns:
      the value of the allAttributesBonus record component