Package forgottentowns.mod.api
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 underscoresnameKey- localized display-name key beginning with mods.biome- uppercase biome identifier controlling travelexports- recurring production per season; host validation/packing conversion follows estimate tablessourceStage- campaign stage whose saved town supplies reservations and its purse; empty for an independent marketinitialGold- 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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbiome()Returns the value of thebiomerecord 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.id()Returns the value of theidrecord component.intReturns the value of theinitialGoldrecord component.nameKey()Returns the value of thenameKeyrecord component.Returns the value of thesourceStagerecord component.final StringtoString()Returns a string representation of this record class.
-
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 identitynameKey- localized market labelbiome- market biomeexports- seasonal goodssourceStage- corresponding campaign stage, or emptyinitialGold- starting purse- Throws:
NullPointerException- if exports, a resource key, or a quantity 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 '=='. -
id
Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
nameKey
Returns the value of thenameKeyrecord component.- Returns:
- the value of the
nameKeyrecord component
-
biome
Returns the value of thebiomerecord component.- Returns:
- the value of the
biomerecord component
-
exports
Returns the value of theexportsrecord component.- Returns:
- the value of the
exportsrecord component
-
sourceStage
Returns the value of thesourceStagerecord component.- Returns:
- the value of the
sourceStagerecord component
-
initialGold
public int initialGold()Returns the value of theinitialGoldrecord component.- Returns:
- the value of the
initialGoldrecord component
-