Record Class TechRequirement
java.lang.Object
java.lang.Record
net.chen.legacyLand.item.attribute.TechRequirement
-
Constructor Summary
ConstructorsConstructorDescriptionTechRequirement(String lineId, int requiredTier) Creates an instance of aTechRequirementrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondoubleefficiencyRatio(int nationMaxTier) 计算效能比例(0.0 ~ 1.0),不足时按比例降低final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanisMet(int nationMaxTier) 检查国家已完成的节点中,指定科技线的最高 tier 是否满足需求lineId()Returns the value of thelineIdrecord component.intReturns the value of therequiredTierrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
TechRequirement
Creates an instance of aTechRequirementrecord class.- Parameters:
lineId- the value for thelineIdrecord componentrequiredTier- the value for therequiredTierrecord component
-
-
Method Details
-
isMet
public boolean isMet(int nationMaxTier) 检查国家已完成的节点中,指定科技线的最高 tier 是否满足需求- Parameters:
nationMaxTier- 国家在该科技线上已达到的最高 tier
-
efficiencyRatio
public double efficiencyRatio(int nationMaxTier) 计算效能比例(0.0 ~ 1.0),不足时按比例降低 -
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
lineId
Returns the value of thelineIdrecord component.- Returns:
- the value of the
lineIdrecord component
-
requiredTier
public int requiredTier()Returns the value of therequiredTierrecord component.- Returns:
- the value of the
requiredTierrecord component
-