Record Class Mission

java.lang.Object
java.lang.Record
idlab.colonyops.model.Mission
Record Components:
id - the mission's unique identifier
colonyId - the identifier of the colony this mission belongs to
planet - the planet the mission is taking place on
turnNumber - the current turn number
controlState - the colony's mission-scoped state (tech effects, cooldowns, resources)
colonyResources - the colony's total resources in the strategic layer, keyed by resource type
upkeepCosts - the upkeep the colony is expected to pay at the end of this mission, keyed by resource type

public record Mission(String id, String colonyId, Planet planet, int turnNumber, MissionControl controlState, Map<ResourceType, Long> colonyResources, Map<ResourceType, Long> upkeepCosts) extends Record
The state of an active planetary mission, sent to the player's logic service on POST /missions (mission start) and PUT /missions/{missionId} (each new turn).
  • Constructor Details

  • 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.
    • id

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

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

      public Planet planet()
      Returns the value of the planet record component.
      Returns:
      the value of the planet record component
    • turnNumber

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

      public MissionControl controlState()
      Returns the value of the controlState record component.
      Returns:
      the value of the controlState record component
    • colonyResources

      public Map<ResourceType, Long> colonyResources()
      Returns the value of the colonyResources record component.
      Returns:
      the value of the colonyResources record component
    • upkeepCosts

      public Map<ResourceType, Long> upkeepCosts()
      Returns the value of the upkeepCosts record component.
      Returns:
      the value of the upkeepCosts record component