Package forgottentowns.mod.api
Record Class SettlementMap.Location
java.lang.Object
java.lang.Record
forgottentowns.mod.api.SettlementMap.Location
- Record Components:
stageId- canonical stage used for coordinates and completionnameKey- localized city name when no saved player name is availabledescriptionKey- localized city descriptionexports- authored seasonal exports for informational display without a trade modrecruits- authored arrival offersuseSettlementName- whether saved player names override the authored name
- Enclosing interface:
SettlementMap
public static record SettlementMap.Location(String stageId, String nameKey, String descriptionKey, Map<String,Integer> exports, List<SettlementMap.Recruit> recruits, boolean useSettlementName)
extends Record
A city entry, separate from the campaign mission presentation.
-
Constructor Summary
ConstructorsConstructorDescriptionLocation(String stageId, String nameKey, String descriptionKey, Map<String, Integer> exports, List<SettlementMap.Recruit> recruits) Creates a location that uses the saved settlement name.Location(String stageId, String nameKey, String descriptionKey, Map<String, Integer> exports, List<SettlementMap.Recruit> recruits, boolean useSettlementName) Detaches collections. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thedescriptionKeyrecord component.final booleanIndicates whether some other object is "equal to" this one.exports()Returns the value of theexportsrecord component.final inthashCode()Returns a hash code value for this object.nameKey()Returns the value of thenameKeyrecord component.recruits()Returns the value of therecruitsrecord component.stageId()Returns the value of thestageIdrecord component.final StringtoString()Returns a string representation of this record class.booleanReturns the value of theuseSettlementNamerecord component.
-
Constructor Details
-
Location
public Location(String stageId, String nameKey, String descriptionKey, Map<String, Integer> exports, List<SettlementMap.Recruit> recruits) Creates a location that uses the saved settlement name.- Parameters:
stageId- canonical stage identitynameKey- localized fallback namedescriptionKey- localized descriptionexports- informational seasonal productsrecruits- unit offers- Throws:
NullPointerException- if a collection or collection element is null
-
Location
public Location(String stageId, String nameKey, String descriptionKey, Map<String, Integer> exports, List<SettlementMap.Recruit> recruits, boolean useSettlementName) Detaches collections.- Parameters:
stageId- canonical stage identitynameKey- localized namedescriptionKey- localized descriptionexports- informational seasonal productsrecruits- unit offersuseSettlementName- use the saved settlement name- Throws:
NullPointerException- if a collection or collection element is null
-
-
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 '=='. -
stageId
Returns the value of thestageIdrecord component.- Returns:
- the value of the
stageIdrecord component
-
nameKey
Returns the value of thenameKeyrecord component.- Returns:
- the value of the
nameKeyrecord component
-
descriptionKey
Returns the value of thedescriptionKeyrecord component.- Returns:
- the value of the
descriptionKeyrecord component
-
exports
Returns the value of theexportsrecord component.- Returns:
- the value of the
exportsrecord component
-
recruits
Returns the value of therecruitsrecord component.- Returns:
- the value of the
recruitsrecord component
-
useSettlementName
public boolean useSettlementName()Returns the value of theuseSettlementNamerecord component.- Returns:
- the value of the
useSettlementNamerecord component
-