Package forgottentowns.mod.api
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 namespacenameKey- owned localized faction namedescriptionKey- owned localized summary, including any purchasing exclusionsbiome- native uppercase biome used for presentationx- normalized map coordinate within zero and oney- normalized map coordinate within zero and onetravelDays- delivery days for both goods and people, within 1..48exports- up to 64 seasonal goods with quantities within 0..100000recruits- up to 32 independently limited seasonal offersrefusedResources- goods the faction will not buy from the playerbuyFromPlayerPercent- percentage of registry value paid to the player, within 0..1000; rounded per unit to whole gold, with zero prohibiting that saleinitialGold- one-time opening purse within 0..100000seasonalGold- 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 Summary
ConstructorsConstructorDescriptionFaction(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. -
Method Summary
Modifier and TypeMethodDescriptionbiome()Returns the value of thebiomerecord component.intReturns the value of thebuyFromPlayerPercentrecord component.Returns the value of thedescriptionKeyrecord 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.recruits()Returns the value of therecruitsrecord component.Returns the value of therefusedResourcesrecord component.intReturns the value of theseasonalGoldrecord component.final StringtoString()Returns a string representation of this record class.intReturns the value of thetravelDaysrecord component.doublex()Returns the value of thexrecord component.doubley()Returns the value of theyrecord component.
-
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 identitynameKey- owned name keydescriptionKey- owned summary keybiome- native biomex- normalized horizontal coordinatey- normalized vertical coordinatetravelDays- delivery durationexports- seasonal stockrecruits- seasonal people offersrefusedResources- purchase exclusionsbuyFromPlayerPercent- player-sale valuation percentageinitialGold- opening purseseasonalGold- seasonal purse grant- Throws:
NullPointerException- if a collection or any collection element 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
-
descriptionKey
Returns the value of thedescriptionKeyrecord component.- Returns:
- the value of the
descriptionKeyrecord component
-
biome
Returns the value of thebiomerecord component.- Returns:
- the value of the
biomerecord component
-
x
public double x()Returns the value of thexrecord component.- Returns:
- the value of the
xrecord component
-
y
public double y()Returns the value of theyrecord component.- Returns:
- the value of the
yrecord component
-
travelDays
public int travelDays()Returns the value of thetravelDaysrecord component.- Returns:
- the value of the
travelDaysrecord component
-
exports
Returns the value of theexportsrecord component.- Returns:
- the value of the
exportsrecord component
-
recruits
Returns the value of therecruitsrecord component.- Returns:
- the value of the
recruitsrecord component
-
refusedResources
Returns the value of therefusedResourcesrecord component.- Returns:
- the value of the
refusedResourcesrecord component
-
buyFromPlayerPercent
public int buyFromPlayerPercent()Returns the value of thebuyFromPlayerPercentrecord component.- Returns:
- the value of the
buyFromPlayerPercentrecord component
-
initialGold
public int initialGold()Returns the value of theinitialGoldrecord component.- Returns:
- the value of the
initialGoldrecord component
-
seasonalGold
public int seasonalGold()Returns the value of theseasonalGoldrecord component.- Returns:
- the value of the
seasonalGoldrecord component
-