Record Class SettlementMap.Location

java.lang.Object
java.lang.Record
forgottentowns.mod.api.SettlementMap.Location
Record Components:
stageId - canonical stage used for coordinates and completion
nameKey - localized city name when no saved player name is available
descriptionKey - localized city description
exports - authored seasonal exports for informational display without a trade mod
recruits - authored arrival offers
useSettlementName - 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 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 identity
      nameKey - localized fallback name
      descriptionKey - localized description
      exports - informational seasonal products
      recruits - 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 identity
      nameKey - localized name
      descriptionKey - localized description
      exports - informational seasonal products
      recruits - unit offers
      useSettlementName - use the saved settlement name
      Throws:
      NullPointerException - if a collection or collection element is null
  • 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 '=='.
      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.
    • stageId

      public String stageId()
      Returns the value of the stageId record component.
      Returns:
      the value of the stageId record component
    • nameKey

      public String nameKey()
      Returns the value of the nameKey record component.
      Returns:
      the value of the nameKey record component
    • descriptionKey

      public String descriptionKey()
      Returns the value of the descriptionKey record component.
      Returns:
      the value of the descriptionKey record component
    • exports

      public Map<String,Integer> exports()
      Returns the value of the exports record component.
      Returns:
      the value of the exports record component
    • recruits

      public List<SettlementMap.Recruit> recruits()
      Returns the value of the recruits record component.
      Returns:
      the value of the recruits record component
    • useSettlementName

      public boolean useSettlementName()
      Returns the value of the useSettlementName record component.
      Returns:
      the value of the useSettlementName record component