Package forgottentowns.mod.api
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 allowedconsumesFood- whether ordinary eating is needed; false maintains fed needs automaticallyneedsBed- whether an individual bed is required; false also maintains rest automaticallyscale- multiplier for actor rendering, from 0.25 to 2visualArchetype- existing visual archetype override, or emptyhousehold- owning-mod namespaced household identity, or emptypreferredBed- stable bed ID, or zero for normal ownership assignmentstatuses- localized entries shown on citizen and soldier rosterspermitsProfession- whether assigned professions and their benefits remain activeallAttributesBonus- 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 Summary
FieldsModifier and TypeFieldDescriptionstatic final ColonyContext.ModifiersNo restrictions or presentation overrides. -
Constructor Summary
ConstructorsConstructorDescriptionModifiers(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.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. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of theallAttributesBonusrecord component.booleancanWork()Returns the value of thecanWorkrecord component.booleanReturns the value of theconsumesFoodrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of thehouseholdrecord component.booleanneedsBed()Returns the value of theneedsBedrecord component.booleanReturns the value of thepermitsProfessionrecord component.longReturns the value of thepreferredBedrecord component.doublescale()Returns the value of thescalerecord component.statuses()Returns the value of thestatusesrecord component.final StringtoString()Returns a string representation of this record class.Returns the value of thevisualArchetyperecord component.
-
Field Details
-
NONE
No restrictions or presentation overrides.
-
-
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 workconsumesFood- require ordinary eatingneedsBed- require own bedscale- visual multipliervisualArchetype- visual overridehousehold- household identitypreferredBed- bed identitystatuses- roster statuses- Throws:
IllegalArgumentException- if scale or bed ID is invalid or too many statuses are suppliedNullPointerException- 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 workconsumesFood- require ordinary eatingneedsBed- require own bedscale- visual multipliervisualArchetype- visual overridehousehold- household identitypreferredBed- bed identitystatuses- roster statusespermitsProfession- permit profession effectsallAttributesBonus- bonus to each primary attribute- Throws:
IllegalArgumentException- if scale, bed ID or bonus is invalid or more than eight statuses are suppliedNullPointerException- if a text value, the statuses list, or a status entry is null
-
-
Method Details
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
canWork
public boolean canWork()Returns the value of thecanWorkrecord component.- Returns:
- the value of the
canWorkrecord component
-
consumesFood
public boolean consumesFood()Returns the value of theconsumesFoodrecord component.- Returns:
- the value of the
consumesFoodrecord component
-
needsBed
public boolean needsBed()Returns the value of theneedsBedrecord component.- Returns:
- the value of the
needsBedrecord component
-
scale
public double scale()Returns the value of thescalerecord component.- Returns:
- the value of the
scalerecord component
-
visualArchetype
Returns the value of thevisualArchetyperecord component.- Returns:
- the value of the
visualArchetyperecord component
-
household
Returns the value of thehouseholdrecord component.- Returns:
- the value of the
householdrecord component
-
preferredBed
public long preferredBed()Returns the value of thepreferredBedrecord component.- Returns:
- the value of the
preferredBedrecord component
-
statuses
Returns the value of thestatusesrecord component.- Returns:
- the value of the
statusesrecord component
-
permitsProfession
public boolean permitsProfession()Returns the value of thepermitsProfessionrecord component.- Returns:
- the value of the
permitsProfessionrecord component
-
allAttributesBonus
public int allAttributesBonus()Returns the value of theallAttributesBonusrecord component.- Returns:
- the value of the
allAttributesBonusrecord component
-