Package zombie.core

Class Rand

java.lang.Object
zombie.core.Rand

public final class Rand extends Object
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static 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

    Fields
    Modifier and Type
    Field
    Description
    static int
     
    static org.uncommons.maths.random.CellularAutomatonRNG
     
    static org.uncommons.maths.random.CellularAutomatonRNG
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static int
    AdjustForFramerate(int chance)
     
    static void
     
    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.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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) and bound (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)