Record Class PoliticalSystem
java.lang.Object
java.lang.Record
net.chen.legacyLand.nation.politics.PoliticalSystem
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecustomEffectsrecord component.Returns the value of thedescriptionrecord component.Returns the value of thedisplayNamerecord component.effects()Returns the value of theeffectsrecord component.final booleanIndicates whether some other object is "equal to" this one.获取该政体下允许的 NationRole 列表double获取指定效果值获取该政体的领袖角色int获取最大同盟数量修正int获取城镇最大数量修正double获取军事力量倍率double获取税收效率倍率double获取国库收入倍率double获取战争冷却时间倍率final inthashCode()Returns a hash code value for this object.id()Returns the value of theidrecord component.booleanisRoleAllowed(NationRole role) 检查该政体下是否允许指定角色Returns the value of theroleNamesrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
PoliticalSystem
public PoliticalSystem(String id, String displayName, String description, List<String> roleNames, Map<String, Double> effects, Map<String, Object> customEffects) Creates an instance of aPoliticalSystemrecord class.- Parameters:
id- the value for theidrecord componentdisplayName- the value for thedisplayNamerecord componentdescription- the value for thedescriptionrecord componentroleNames- the value for theroleNamesrecord componenteffects- the value for theeffectsrecord componentcustomEffects- the value for thecustomEffectsrecord component
-
-
Method Details
-
getTaxEfficiency
public double getTaxEfficiency()获取税收效率倍率 -
getMilitaryStrength
public double getMilitaryStrength()获取军事力量倍率 -
getMaxAllianceModifier
public int getMaxAllianceModifier()获取最大同盟数量修正 -
getMaxTownModifier
public int getMaxTownModifier()获取城镇最大数量修正 -
getTreasuryIncome
public double getTreasuryIncome()获取国库收入倍率 -
getWarCooldownModifier
public double getWarCooldownModifier()获取战争冷却时间倍率 -
getEffect
获取指定效果值- Parameters:
key- 效果键名defaultValue- 默认值- Returns:
- 效果值
-
isRoleAllowed
检查该政体下是否允许指定角色 -
getAllowedRoles
获取该政体下允许的 NationRole 列表 -
getLeaderRole
获取该政体的领袖角色 -
toString
-
hashCode
-
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). -
id
Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
displayName
Returns the value of thedisplayNamerecord component.- Returns:
- the value of the
displayNamerecord component
-
description
Returns the value of thedescriptionrecord component.- Returns:
- the value of the
descriptionrecord component
-
roleNames
-
effects
-
customEffects
-