Package forgottentowns.mod.api
Record Class ColonyEvent.HomeChanged
java.lang.Object
java.lang.Record
forgottentowns.mod.api.ColonyEvent.HomeChanged
- Record Components:
citizenId- affected citizen identitypreviousHomeId- former zone identity, or zero when unassignedhomeId- new zone identity, or zero when unassignedposition- first tile of the new home, or of the former home when unassigned; null for a zone with an empty footprintday- monotonic game day of the last assignment change
- All Implemented Interfaces:
ColonyEvent
- Enclosing interface:
ColonyEvent
public static record ColonyEvent.HomeChanged(int citizenId, long previousHomeId, long homeId, ColonyContext.Position position, int day)
extends Record
implements ColonyEvent
One citizen's net home reassignment during a delivery interval.
Intermediate detach/attach steps are coalesced; unchanged final assignments emit nothing.
-
Nested Class Summary
Nested classes/interfaces inherited from interface forgottentowns.mod.api.ColonyEvent
ColonyEvent.Actor, ColonyEvent.CitizenArrived, ColonyEvent.CitizenDied, ColonyEvent.CreatureDied, ColonyEvent.DeathCause, ColonyEvent.HomeChanged, ColonyEvent.PlaceableRemoved -
Constructor Summary
ConstructorsConstructorDescriptionHomeChanged(int citizenId, long previousHomeId, long homeId, ColonyContext.Position position, int day) Creates an instance of aHomeChangedrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of thecitizenIdrecord component.intday()Returns the value of thedayrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.longhomeId()Returns the value of thehomeIdrecord component.position()Returns the value of thepositionrecord component.longReturns the value of thepreviousHomeIdrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
HomeChanged
public HomeChanged(int citizenId, long previousHomeId, long homeId, ColonyContext.Position position, int day) Creates an instance of aHomeChangedrecord class.- Parameters:
citizenId- the value for thecitizenIdrecord componentpreviousHomeId- the value for thepreviousHomeIdrecord componenthomeId- the value for thehomeIdrecord componentposition- the value for thepositionrecord componentday- the value for thedayrecord component
-
-
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 '=='. -
citizenId
public int citizenId()Returns the value of thecitizenIdrecord component.- Returns:
- the value of the
citizenIdrecord component
-
previousHomeId
public long previousHomeId()Returns the value of thepreviousHomeIdrecord component.- Returns:
- the value of the
previousHomeIdrecord component
-
homeId
public long homeId()Returns the value of thehomeIdrecord component.- Returns:
- the value of the
homeIdrecord component
-
position
Returns the value of thepositionrecord component.- Returns:
- the value of the
positionrecord component
-
day
public int day()Returns the value of thedayrecord component.- Specified by:
dayin interfaceColonyEvent- Returns:
- the value of the
dayrecord component
-