Record Class GreaterThanGrowthComparator
java.lang.Object
java.lang.Record
com.pixelmonmod.pixelmon.api.pokemon.growth.comparator.type.GreaterThanGrowthComparator
- All Implemented Interfaces:
GrowthComparator
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<GreaterThanGrowthComparator> -
Constructor Summary
ConstructorsConstructorDescriptionGreaterThanGrowthComparator(double min) Creates an instance of aGreaterThanGrowthComparatorrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncom.mojang.serialization.Codec<GreaterThanGrowthComparator>codec()final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleaninRange(double mean, double standardDeviation, double size) Checks if the growth of the Pokemon is within the configured range for a normal distribution with the given mean and standard deviation.doublemin()Returns the value of theminrecord component.doublerandom(double mean, double standardDeviation) Generates a random value from a normal distribution with the given mean and standard deviation.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
CODEC
-
-
Constructor Details
-
GreaterThanGrowthComparator
public GreaterThanGrowthComparator(double min) Creates an instance of aGreaterThanGrowthComparatorrecord class.- Parameters:
min- the value for theminrecord component
-
-
Method Details
-
codec
- Specified by:
codecin interfaceGrowthComparator
-
inRange
public boolean inRange(double mean, double standardDeviation, double size) Description copied from interface:GrowthComparatorChecks if the growth of the Pokemon is within the configured range for a normal distribution with the given mean and standard deviation.- Specified by:
inRangein interfaceGrowthComparator- Parameters:
mean- The mean of the normal distributionstandardDeviation- The standard deviation of the normal distributionsize- The size of the Pokemon- Returns:
- True if the growth is within the range, false otherwise
-
random
public double random(double mean, double standardDeviation) Description copied from interface:GrowthComparatorGenerates a random value from a normal distribution with the given mean and standard deviation.- Specified by:
randomin interfaceGrowthComparator- Parameters:
mean- The mean of the normal distributionstandardDeviation- The standard deviation of the normal distribution- Returns:
- The random value
-
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 with '=='. -
min
public double min()Returns the value of theminrecord component.- Returns:
- the value of the
minrecord component
-