Record Class LimitContainer
java.lang.Object
java.lang.Record
nl.pim16aap2.animatedarchitecture.core.api.LimitContainer
public record LimitContainer(OptionalInt structureSizeLimit, OptionalInt structureCountLimit, OptionalInt powerBlockDistanceLimit, OptionalInt blocksToMoveLimit)
extends Record
A record that contains the
Limits for a player.-
Constructor Summary
ConstructorsConstructorDescriptionLimitContainer(int structureSizeLimit, int structureCountLimit, int powerBlockDistanceLimit, int blocksToMoveLimit) LimitContainer(@Nullable Integer structureSizeLimit, @Nullable Integer structureCountLimit, @Nullable Integer powerBlockDistanceLimit, @Nullable Integer blocksToMoveLimit) LimitContainer(OptionalInt structureSizeLimit, OptionalInt structureCountLimit, OptionalInt powerBlockDistanceLimit, OptionalInt blocksToMoveLimit) Creates an instance of aLimitContainerrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theblocksToMoveLimitrecord component.final booleanIndicates whether some other object is "equal to" this one.Gets the limit for the specifiedLimit.final inthashCode()Returns a hash code value for this object.static LimitContainerCreates aLimitContainerfrom the givenIPlayer.static LimitContainerof(PlayerData playerData) Creates aLimitContainerfrom the givenPlayerData.Returns the value of thepowerBlockDistanceLimitrecord component.Returns the value of thestructureCountLimitrecord component.Returns the value of thestructureSizeLimitrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
LimitContainer
-
LimitContainer
public LimitContainer(int structureSizeLimit, int structureCountLimit, int powerBlockDistanceLimit, int blocksToMoveLimit) -
LimitContainer
public LimitContainer(OptionalInt structureSizeLimit, OptionalInt structureCountLimit, OptionalInt powerBlockDistanceLimit, OptionalInt blocksToMoveLimit) Creates an instance of aLimitContainerrecord class.- Parameters:
structureSizeLimit- the value for thestructureSizeLimitrecord componentstructureCountLimit- the value for thestructureCountLimitrecord componentpowerBlockDistanceLimit- the value for thepowerBlockDistanceLimitrecord componentblocksToMoveLimit- the value for theblocksToMoveLimitrecord component
-
-
Method Details
-
getLimit
Gets the limit for the specifiedLimit. -
of
Creates aLimitContainerfrom the givenIPlayer.- Parameters:
player- TheIPlayerto create theLimitContainerfrom.- Returns:
- The created
LimitContainer.
-
of
Creates aLimitContainerfrom the givenPlayerData.- Parameters:
playerData- ThePlayerDatato create theLimitContainerfrom.- Returns:
- The created
LimitContainer.
-
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). -
structureSizeLimit
Returns the value of thestructureSizeLimitrecord component.- Returns:
- the value of the
structureSizeLimitrecord component
-
structureCountLimit
Returns the value of thestructureCountLimitrecord component.- Returns:
- the value of the
structureCountLimitrecord component
-
powerBlockDistanceLimit
Returns the value of thepowerBlockDistanceLimitrecord component.- Returns:
- the value of the
powerBlockDistanceLimitrecord component
-
blocksToMoveLimit
Returns the value of theblocksToMoveLimitrecord component.- Returns:
- the value of the
blocksToMoveLimitrecord component
-