Record Class TechNode
java.lang.Object
java.lang.Record
net.chen.legacyLand.nation.tech.TechNode
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintcost()Returns the value of thecostrecord 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.double获取效果值,不存在返回 0boolean检查某个效果键是否存在final inthashCode()Returns a hash code value for this object.id()Returns the value of theidrecord component.lineId()Returns the value of thelineIdrecord component.Returns the value of theprerequisitesrecord component.inttier()Returns the value of thetierrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
TechNode
public TechNode(String id, String lineId, int tier, String displayName, String description, int cost, List<String> prerequisites, Map<String, Double> effects) Creates an instance of aTechNoderecord class.- Parameters:
id- the value for theidrecord componentlineId- the value for thelineIdrecord componenttier- the value for thetierrecord componentdisplayName- the value for thedisplayNamerecord componentdescription- the value for thedescriptionrecord componentcost- the value for thecostrecord componentprerequisites- the value for theprerequisitesrecord componenteffects- the value for theeffectsrecord component
-
-
Method Details
-
hasEffect
检查某个效果键是否存在 -
getEffect
获取效果值,不存在返回 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. -
id
Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
lineId
Returns the value of thelineIdrecord component.- Returns:
- the value of the
lineIdrecord component
-
tier
public int tier()Returns the value of thetierrecord component.- Returns:
- the value of the
tierrecord 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
-
cost
public int cost()Returns the value of thecostrecord component.- Returns:
- the value of the
costrecord component
-
prerequisites
-
effects
-