T
- The seed object type@FunctionalInterface public interface SeededVariableAmount<T>
Modifier and Type | Interface and Description |
---|---|
static class |
SeededVariableAmount.WrappedVariableAmount<T>
A
SeededVariableAmount which wraps another VariableAmount
and defers all operations to the inner VariableAmount without the seed. |
Modifier and Type | Method and Description |
---|---|
static <T> SeededVariableAmount<T> |
fixed(double value)
Creates a new 'fixed' variable amount, calls to
getAmount(java.util.Random, T) will
always return the fixed value. |
double |
getAmount(Random rand,
T seed)
Gets an instance of the variable amount depending on the given random
object and the seed object.
|
default int |
getFlooredAmount(Random rand,
T seed)
Gets the amount as if from
getAmount(Random, Object) but floored
to the nearest integer equivalent. |
static <T> SeededVariableAmount<T> |
wrapped(VariableAmount value)
Creates a new variable amount wrapping the given
VariableAmount ,
calls to getAmount(java.util.Random, T) will always return wrapped amounts value. |
static <T> SeededVariableAmount<T> fixed(double value)
getAmount(java.util.Random, T)
will
always return the fixed value.T
- The seed object typevalue
- The fixed valuestatic <T> SeededVariableAmount<T> wrapped(VariableAmount value)
VariableAmount
,
calls to getAmount(java.util.Random, T)
will always return wrapped amounts value.T
- The seed object typevalue
- The wrapped variable amountdouble getAmount(Random rand, T seed)
rand
- The random objectseed
- The seed objectdefault int getFlooredAmount(Random rand, T seed)
getAmount(Random, Object)
but floored
to the nearest integer equivalent.rand
- The random objectseed
- The seed object