Package forgottentowns.mod.api
Record Class ColonyEvent.CitizenDied
java.lang.Object
java.lang.Record
forgottentowns.mod.api.ColonyEvent.CitizenDied
- Record Components:
citizen- detached dead actorcause- known native cause, never inferred from nearby actorsattackerName- recorded attacker name, or empty; not a stable actor identityday- monotonic game day
- All Implemented Interfaces:
ColonyEvent
- Enclosing interface:
ColonyEvent
public static record ColonyEvent.CitizenDied(ColonyEvent.Actor citizen, ColonyEvent.DeathCause cause, String attackerName, int day)
extends Record
implements ColonyEvent
A citizen entered the native death sequence after immediate resurrection checks.
Later resurrection remains possible; removal of the corpse is not a second death.
-
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
ConstructorsConstructorDescriptionCitizenDied(ColonyEvent.Actor citizen, ColonyEvent.DeathCause cause, String attackerName, int day) Creates an instance of aCitizenDiedrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theattackerNamerecord component.cause()Returns the value of thecauserecord component.citizen()Returns the value of thecitizenrecord 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.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
CitizenDied
public CitizenDied(ColonyEvent.Actor citizen, ColonyEvent.DeathCause cause, String attackerName, int day) Creates an instance of aCitizenDiedrecord class.- Parameters:
citizen- the value for thecitizenrecord componentcause- the value for thecauserecord componentattackerName- the value for theattackerNamerecord 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 '=='. -
citizen
Returns the value of thecitizenrecord component.- Returns:
- the value of the
citizenrecord component
-
cause
Returns the value of thecauserecord component.- Returns:
- the value of the
causerecord component
-
attackerName
Returns the value of theattackerNamerecord component.- Returns:
- the value of the
attackerNamerecord component
-
day
public int day()Returns the value of thedayrecord component.- Specified by:
dayin interfaceColonyEvent- Returns:
- the value of the
dayrecord component
-