Interface GrowthComparator
- All Known Implementing Classes:
GreaterThanGrowthComparator
,LessThanGrowthComparator
,RangeGrowthComparator
public interface GrowthComparator
Used for comparing the growth of a Pokemon to the
mean and standard deviation of a normal distribution.
This can also be used to generate random values from a normal distribution within the range being detected by this comparator.
This can also be used to generate random values from a normal distribution within the range being detected by this comparator.
- Since:
- 01/10/2024
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptioncom.mojang.serialization.Codec<? extends GrowthComparator>
codec()
boolean
inRange
(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.double
random
(double mean, double standardDeviation) Generates a random value from a normal distribution with the given mean and standard deviation.
-
Field Details
-
CODEC
-
-
Method Details
-
codec
com.mojang.serialization.Codec<? extends GrowthComparator> codec() -
inRange
boolean inRange(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.- 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
double random(double mean, double standardDeviation) Generates a random value from a normal distribution with the given mean and standard deviation.- Parameters:
mean
- The mean of the normal distributionstandardDeviation
- The standard deviation of the normal distribution- Returns:
- The random value
-