Package zombie.core
Class Rand
java.lang.Object
zombie.core.Rand
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
Custom class to disable DevRandomSeedGenerator() on Linux since it can block forever, and disable RandomDotOrgSeedGenerator() since it connects to the internet. -
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic int
AdjustForFramerate
(int chance) static void
init()
static float
Next
(float min, float max) static float
Next
(float min, float max, org.uncommons.maths.random.CellularAutomatonRNG randomizer) static int
Next
(int max) static int
Next
(int min, int max) static int
Next
(int min, int max, org.uncommons.maths.random.CellularAutomatonRNG randomizer) static long
Next
(long max) static long
Next
(long min, long max) static long
Next
(long min, long max, org.uncommons.maths.random.CellularAutomatonRNG randomizer) static long
Next
(long max, org.uncommons.maths.random.CellularAutomatonRNG randomizer) static boolean
NextBool
(int invProbability) Returns random TRUE or FALSE, based on the inverse probability value supplied.
-
Field Details
-
rand
public static org.uncommons.maths.random.CellularAutomatonRNG rand -
randlua
public static org.uncommons.maths.random.CellularAutomatonRNG randlua -
id
public static int id
-
-
Constructor Details
-
Rand
public Rand()
-
-
Method Details
-
init
public static void init() -
Next
public static int Next(int max) - Parameters:
max
- the upper bound (exclusive). Must be positive.- Returns:
- the next pseudorandom, uniformly distributed
int
value between zero (inclusive) andbound
(exclusive) from this random number generator's sequence
-
Next
public static long Next(long max, org.uncommons.maths.random.CellularAutomatonRNG randomizer) -
Next
public static long Next(long max) -
Next
public static int Next(int min, int max, org.uncommons.maths.random.CellularAutomatonRNG randomizer) -
Next
public static int Next(int min, int max) -
Next
public static long Next(long min, long max, org.uncommons.maths.random.CellularAutomatonRNG randomizer) -
Next
public static long Next(long min, long max) -
Next
public static float Next(float min, float max, org.uncommons.maths.random.CellularAutomatonRNG randomizer) -
Next
public static float Next(float min, float max) -
NextBool
public static boolean NextBool(int invProbability) Returns random TRUE or FALSE, based on the inverse probability value supplied. Basically, returns TRUE if the next rand(invProbability) returns 0. eg. NextBool(10) has a one in 10 chance of returning TRUE.- Parameters:
invProbability
- The inverse probability of returning TRUE. The one in- chance.
-
AdjustForFramerate
public static int AdjustForFramerate(int chance)
-