Package forgottentowns.mod.api
Record Class SettlementTradeCore
java.lang.Object
java.lang.Record
forgottentowns.mod.api.SettlementTradeCore
- Record Components:
economy- validated pricing, travel, income and export settingsproductionRules- legacy production assumptions retained for compiled-pack compatibility; recorded packing output does not use these assumptions
public record SettlementTradeCore(TradeEconomy economy, TradeProductionRules productionRules)
extends Record
Immutable shared configuration published by a trading core mod.
Consumers keep the same economy and production rules as the provider instead of copying settings.
Individual markets may still declare explicit prices, supply and delivery terms.
-
Constructor Summary
ConstructorsConstructorDescriptionSettlementTradeCore(TradeEconomy economy, TradeProductionRules productionRules) Requires both shared rule sets. -
Method Summary
Modifier and TypeMethodDescriptioneconomy()Returns the value of theeconomyrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of theproductionRulesrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
SettlementTradeCore
Requires both shared rule sets.- Parameters:
economy- validated economy settingsproductionRules- retained legacy production configuration- Throws:
NullPointerException- if either rule set 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. All components in this record class are compared withObjects::equals(Object,Object). -
economy
Returns the value of theeconomyrecord component.- Returns:
- the value of the
economyrecord component
-
productionRules
Returns the value of theproductionRulesrecord component.- Returns:
- the value of the
productionRulesrecord component
-