Record Class SettlementTrading.Market

java.lang.Object
java.lang.Record
forgottentowns.mod.api.SettlementTrading.Market
Record Components:
id - unique market identity matching lower-case namespace:name syntax with letters, digits, and underscores
nameKey - localized display-name key beginning with mods.
biome - uppercase biome identifier controlling travel
exports - recurring production per season; host validation/packing conversion follows estimate tables
sourceStage - campaign stage whose saved town supplies reservations and its purse; empty for an independent market
initialGold - one-time opening purse in 0..100000
Enclosing interface:
SettlementTrading

public static record SettlementTrading.Market(String id, String nameKey, String biome, Map<String,Integer> exports, String sourceStage, int initialGold) extends Record
An authored market, with its own finite purse and seasonal production.
  • Constructor Details

    • Market

      public Market(String id, String nameKey, String biome, Map<String,Integer> exports, String sourceStage, int initialGold)
      Detaches authored goods.
      Parameters:
      id - stable market identity
      nameKey - localized market label
      biome - market biome
      exports - seasonal goods
      sourceStage - corresponding campaign stage, or empty
      initialGold - starting purse
      Throws:
      NullPointerException - if exports, a resource key, or a quantity 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
    • biome

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

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

      public String sourceStage()
      Returns the value of the sourceStage record component.
      Returns:
      the value of the sourceStage record component
    • initialGold

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