Record Class MissionEvent
java.lang.Object
java.lang.Record
idlab.colonyops.model.events.MissionEvent
- Record Components:
missionId- the mission this event belongs toturnNumber- the turn on which the event occurredsubjectEntityId- the entity the event is about. Always present, but empty for theGameOverActionOutcomeevent, which is not about any entitysubjectLocation- the location of the subject entity. Always presentaction- the action that occurredoutcome- the result of the action, ornullif the action tells it allcolonyId- the colony the subject entity belongs to, ornullif it does not belong to a colony
public record MissionEvent(String missionId, int turnNumber, String subjectEntityId, Location subjectLocation, Action action, ActionOutcome outcome, String colonyId)
extends Record
A piece of chatter: something that happened somewhere on the map, as picked up by a colony.
Chatter covers events from across the map, including the colony's own actions. It gives the
context of the event (the mission, the turn, the entity involved and where it was), the
Action that occurred and the ActionOutcome describing its result. The outcome
is null for actions whose result is fully described by the action itself (e.g.
MoveAction).
-
Constructor Summary
ConstructorsConstructorDescriptionMissionEvent(String missionId, int turnNumber, String subjectEntityId, Location subjectLocation, Action action, ActionOutcome outcome, String colonyId) Creates an instance of aMissionEventrecord class. -
Method Summary
Modifier and TypeMethodDescriptionaction()Returns the value of theactionrecord component.colonyId()Returns the value of thecolonyIdrecord 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 themissionIdrecord component.outcome()Returns the value of theoutcomerecord component.Returns the value of thesubjectEntityIdrecord component.Returns the value of thesubjectLocationrecord component.final StringtoString()Returns a string representation of this record class.intReturns the value of theturnNumberrecord component.
-
Constructor Details
-
MissionEvent
public MissionEvent(String missionId, int turnNumber, String subjectEntityId, Location subjectLocation, Action action, ActionOutcome outcome, String colonyId) Creates an instance of aMissionEventrecord class.- Parameters:
missionId- the value for themissionIdrecord componentturnNumber- the value for theturnNumberrecord componentsubjectEntityId- the value for thesubjectEntityIdrecord componentsubjectLocation- the value for thesubjectLocationrecord componentaction- the value for theactionrecord componentoutcome- the value for theoutcomerecord componentcolonyId- the value for thecolonyIdrecord component
-
-
Method Details
-
toString
-
hashCode
-
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 thecomparemethod from their corresponding wrapper classes. -
missionId
-
turnNumber
public int turnNumber()Returns the value of theturnNumberrecord component.- Returns:
- the value of the
turnNumberrecord component
-
subjectEntityId
Returns the value of thesubjectEntityIdrecord component.- Returns:
- the value of the
subjectEntityIdrecord component
-
subjectLocation
Returns the value of thesubjectLocationrecord component.- Returns:
- the value of the
subjectLocationrecord component
-
action
-
outcome
-
colonyId
-