Package forgottentowns.mod.api
Record Class ColonyEvent.CreatureDied
java.lang.Object
java.lang.Record
forgottentowns.mod.api.ColonyEvent.CreatureDied
- Record Components:
creature- detached dead actorcreditedCitizenId- native kill-credit citizen identity, or zero when unavailablenatural- whether native bookkeeping identifies a natural deathday- monotonic game day
- All Implemented Interfaces:
ColonyEvent
- Enclosing interface:
ColonyEvent
public static record ColonyEvent.CreatureDied(ColonyEvent.Actor creature, int creditedCitizenId, boolean natural, int day)
extends Record
implements ColonyEvent
A creature's final death after its automatic revival/transformation checks.
-
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
ConstructorsConstructorDescriptionCreatureDied(ColonyEvent.Actor creature, int creditedCitizenId, boolean natural, int day) Creates an instance of aCreatureDiedrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncreature()Returns the value of thecreaturerecord component.intReturns the value of thecreditedCitizenIdrecord 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.booleannatural()Returns the value of thenaturalrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
CreatureDied
Creates an instance of aCreatureDiedrecord class.- Parameters:
creature- the value for thecreaturerecord componentcreditedCitizenId- the value for thecreditedCitizenIdrecord componentnatural- the value for thenaturalrecord 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 '=='. -
creature
Returns the value of thecreaturerecord component.- Returns:
- the value of the
creaturerecord component
-
creditedCitizenId
public int creditedCitizenId()Returns the value of thecreditedCitizenIdrecord component.- Returns:
- the value of the
creditedCitizenIdrecord component
-
natural
public boolean natural()Returns the value of thenaturalrecord component.- Returns:
- the value of the
naturalrecord component
-
day
public int day()Returns the value of thedayrecord component.- Specified by:
dayin interfaceColonyEvent- Returns:
- the value of the
dayrecord component
-