Package forgottentowns.mod.api
Record Class ColonyEvent.Actor
java.lang.Object
java.lang.Record
forgottentowns.mod.api.ColonyEvent.Actor
- Record Components:
id- stable actor identity within its kind and worlddefinitionId- citizen archetype or creature definitionname- display name at capture time; suitable as a notification argumentposition- last known tile, or null if unavailable
- Enclosing interface:
ColonyEvent
public static record ColonyEvent.Actor(int id, String definitionId, String name, ColonyContext.Position position)
extends Record
Detached actor identity captured when an event occurred.
-
Constructor Summary
ConstructorsConstructorDescriptionActor(int id, String definitionId, String name, ColonyContext.Position position) Creates an instance of aActorrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thedefinitionIdrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intid()Returns the value of theidrecord component.name()Returns the value of thenamerecord component.position()Returns the value of thepositionrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Actor
Creates an instance of aActorrecord class.- Parameters:
id- the value for theidrecord componentdefinitionId- the value for thedefinitionIdrecord componentname- the value for thenamerecord componentposition- the value for thepositionrecord 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 '=='. -
id
public int id()Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
definitionId
Returns the value of thedefinitionIdrecord component.- Returns:
- the value of the
definitionIdrecord component
-
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
position
Returns the value of thepositionrecord component.- Returns:
- the value of the
positionrecord component
-