Record Class SettlementMap.Faction

java.lang.Object
java.lang.Record
forgottentowns.mod.api.SettlementMap.Faction
Record Components:
id - stable identity in the registering mod's namespace
nameKey - owned localized faction name
descriptionKey - owned localized summary, including any purchasing exclusions
biome - native uppercase biome used for presentation
x - normalized map coordinate within zero and one
y - normalized map coordinate within zero and one
travelDays - delivery days for both goods and people, within 1..48
exports - up to 64 seasonal goods with quantities within 0..100000
recruits - up to 32 independently limited seasonal offers
refusedResources - goods the faction will not buy from the player
buyFromPlayerPercent - percentage of registry value paid to the player, within 0..1000; rounded per unit to whole gold, with zero prohibiting that sale
initialGold - one-time opening purse within 0..100000
seasonalGold - purse replenishment per shared season within 0..100000
Enclosing interface:
SettlementMap

public static record SettlementMap.Faction(String id, String nameKey, String descriptionKey, String biome, double x, double y, int travelDays, Map<String,Integer> exports, List<SettlementMap.Recruit> recruits, Set<String> refusedResources, int buyFromPlayerPercent, int initialGold, int seasonalGold) extends Record
An independent map faction with seasonal goods, recruitment and its own trade terms. Faction visibility is controlled by the policy; native campaign recruitment restrictions still apply.
  • Constructor Details

    • Faction

      public Faction(String id, String nameKey, String descriptionKey, String biome, double x, double y, int travelDays, Map<String,Integer> exports, List<SettlementMap.Recruit> recruits, Set<String> refusedResources, int buyFromPlayerPercent, int initialGold, int seasonalGold)
      Detaches authored collections; the host validates references and scalar bounds.
      Parameters:
      id - stable namespaced identity
      nameKey - owned name key
      descriptionKey - owned summary key
      biome - native biome
      x - normalized horizontal coordinate
      y - normalized vertical coordinate
      travelDays - delivery duration
      exports - seasonal stock
      recruits - seasonal people offers
      refusedResources - purchase exclusions
      buyFromPlayerPercent - player-sale valuation percentage
      initialGold - opening purse
      seasonalGold - seasonal purse grant
      Throws:
      NullPointerException - if a collection or any 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.
    • id

      public String id()
      Returns the value of the id record component.
      Returns:
      the value of the id 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
    • biome

      public String biome()
      Returns the value of the biome record component.
      Returns:
      the value of the biome record component
    • x

      public double x()
      Returns the value of the x record component.
      Returns:
      the value of the x record component
    • y

      public double y()
      Returns the value of the y record component.
      Returns:
      the value of the y record component
    • travelDays

      public int travelDays()
      Returns the value of the travelDays record component.
      Returns:
      the value of the travelDays 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
    • refusedResources

      public Set<String> refusedResources()
      Returns the value of the refusedResources record component.
      Returns:
      the value of the refusedResources record component
    • buyFromPlayerPercent

      public int buyFromPlayerPercent()
      Returns the value of the buyFromPlayerPercent record component.
      Returns:
      the value of the buyFromPlayerPercent record component
    • initialGold

      public int initialGold()
      Returns the value of the initialGold record component.
      Returns:
      the value of the initialGold record component
    • seasonalGold

      public int seasonalGold()
      Returns the value of the seasonalGold record component.
      Returns:
      the value of the seasonalGold record component