Class RandomProperty<T>

java.lang.Object
dev.prozilla.pine.common.property.random.RandomProperty<T>
All Implemented Interfaces:
Property<T>, Functor<T>
Direct Known Subclasses:
RandomBooleanProperty, RandomFloatProperty, RandomIntProperty, RandomObjectProperty

public abstract class RandomProperty<T> extends Object implements Property<T>
A property whose value is randomized.
  • Field Details

    • globalRandom

      protected static final Random globalRandom
      The random number generator used to randomize the values of all random properties.
  • Constructor Details

    • RandomProperty

      public RandomProperty()
  • Method Details

    • setGlobalSeed

      public static void setGlobalSeed(long seed)
      Sets the seed for the random number generator used for all random properties.
      Parameters:
      seed - The seed to use
    • setSeed

      public void setSeed(long seed)
      Sets the seed for the random number generator of this property.
      Parameters:
      seed - The seed to use
    • getRandom

      protected Random getRandom()
      Returns the random number generator of this property.
      Returns:
      The random number generator of this property.