Class RandomProperty<T>
java.lang.Object
dev.prozilla.pine.common.property.random.RandomProperty<T>
- Direct Known Subclasses:
RandomBooleanProperty,RandomFloatProperty,RandomIntProperty,RandomObjectProperty
A property whose value is randomized.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final RandomThe random number generator used to randomize the values of all random properties. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected RandomReturns the random number generator of this property.static voidsetGlobalSeed(long seed) Sets the seed for the random number generator used for all random properties.voidsetSeed(long seed) Sets the seed for the random number generator of this property.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface dev.prozilla.pine.common.property.Property
getValue, getValueOr, hasValue, hasValueProperty, isNotNull, isNotNullProperty, isNull, map, replaceNull, requireValue, snapshot, toStringProperty
-
Field Details
-
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
Returns the random number generator of this property.- Returns:
- The random number generator of this property.
-