Record Class LimitModifier
java.lang.Object
java.lang.Record
ua.mcchickenstudio.opencreative.settings.groups.LimitModifier
- Record Components:
limit- original limit.modifier- modifier of world's players count.
LimitModifier
This class represents modifier of limit, that is used for calculating limits.-
Constructor Summary
ConstructorsConstructorDescriptionLimitModifier(int limit, int modifier) Creates an instance of aLimitModifierrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintcalculateLimit(int playersCount) Returns limit by adding modifier multiplied by players count to original limit.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intlimit()Returns the value of thelimitrecord component.intmodifier()Returns the value of themodifierrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
LimitModifier
-
-
Method Details
-
calculateLimit
public int calculateLimit(int playersCount) Returns limit by adding modifier multiplied by players count to original limit.- Parameters:
playersCount- count of players.- Returns:
- limit, that can be used for checks.
-
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 with thecomparemethod from their corresponding wrapper classes. -
limit
-
modifier
-