Record Class MissionEvent

java.lang.Object
java.lang.Record
idlab.colonyops.model.events.MissionEvent
Record Components:
missionId - the mission this event belongs to
turnNumber - the turn on which the event occurred
subjectEntityId - the entity the event is about. Always present, but empty for the GameOverActionOutcome event, which is not about any entity
subjectLocation - the location of the subject entity. Always present
action - the action that occurred
outcome - the result of the action, or null if the action tells it all
colonyId - the colony the subject entity belongs to, or null if 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 Details

    • MissionEvent

      public MissionEvent(String missionId, int turnNumber, String subjectEntityId, Location subjectLocation, Action action, ActionOutcome outcome, String colonyId)
      Creates an instance of a MissionEvent record class.
      Parameters:
      missionId - the value for the missionId record component
      turnNumber - the value for the turnNumber record component
      subjectEntityId - the value for the subjectEntityId record component
      subjectLocation - the value for the subjectLocation record component
      action - the value for the action record component
      outcome - the value for the outcome record component
      colonyId - the value for the colonyId record component
  • Method Details

    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • missionId

      public String missionId()
      Returns the value of the missionId record component.
      Returns:
      the value of the missionId record component
    • turnNumber

      public int turnNumber()
      Returns the value of the turnNumber record component.
      Returns:
      the value of the turnNumber record component
    • subjectEntityId

      public String subjectEntityId()
      Returns the value of the subjectEntityId record component.
      Returns:
      the value of the subjectEntityId record component
    • subjectLocation

      public Location subjectLocation()
      Returns the value of the subjectLocation record component.
      Returns:
      the value of the subjectLocation record component
    • action

      public Action action()
      Returns the value of the action record component.
      Returns:
      the value of the action record component
    • outcome

      public ActionOutcome outcome()
      Returns the value of the outcome record component.
      Returns:
      the value of the outcome record component
    • colonyId

      public String colonyId()
      Returns the value of the colonyId record component.
      Returns:
      the value of the colonyId record component