Record Class Mission
java.lang.Object
java.lang.Record
idlab.colonyops.model.Mission
- Record Components:
id- the mission's unique identifiercolonyId- the identifier of the colony this mission belongs toplanet- the planet the mission is taking place onturnNumber- the current turn numbercontrolState- the colony's mission-scoped state (tech effects, cooldowns, resources)colonyResources- the colony's total resources in the strategic layer, keyed by resource typeupkeepCosts- 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 Summary
ConstructorsConstructorDescriptionMission(String id, String colonyId, Planet planet, int turnNumber, MissionControl controlState, Map<ResourceType, Long> colonyResources, Map<ResourceType, Long> upkeepCosts) Creates an instance of aMissionrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncolonyId()Returns the value of thecolonyIdrecord component.Returns the value of thecolonyResourcesrecord component.Returns the value of thecontrolStaterecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.id()Returns the value of theidrecord component.planet()Returns the value of theplanetrecord component.final StringtoString()Returns a string representation of this record class.intReturns the value of theturnNumberrecord component.Returns the value of theupkeepCostsrecord component.
-
Constructor Details
-
Mission
public Mission(String id, String colonyId, Planet planet, int turnNumber, MissionControl controlState, Map<ResourceType, Long> colonyResources, Map<ResourceType, Long> upkeepCosts) Creates an instance of aMissionrecord class.- Parameters:
id- the value for theidrecord componentcolonyId- the value for thecolonyIdrecord componentplanet- the value for theplanetrecord componentturnNumber- the value for theturnNumberrecord componentcontrolState- the value for thecontrolStaterecord componentcolonyResources- the value for thecolonyResourcesrecord componentupkeepCosts- the value for theupkeepCostsrecord 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. -
id
-
colonyId
-
planet
-
turnNumber
public int turnNumber()Returns the value of theturnNumberrecord component.- Returns:
- the value of the
turnNumberrecord component
-
controlState
Returns the value of thecontrolStaterecord component.- Returns:
- the value of the
controlStaterecord component
-
colonyResources
Returns the value of thecolonyResourcesrecord component.- Returns:
- the value of the
colonyResourcesrecord component
-
upkeepCosts
Returns the value of theupkeepCostsrecord component.- Returns:
- the value of the
upkeepCostsrecord component
-