Class UniformlyRandomSelector<T>
java.lang.Object
com.pixelmonmod.pixelmon.api.selector.type.UniformlyRandomSelector<T>
- Type Parameters:
T- The type being selected
This represents a random selector implementation of
Selector
where each value in the list has an equal value-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<A> Function<com.mojang.serialization.Codec<A>,com.mojang.serialization.Codec<? extends Selector<A>>> codec()Gets the codec for this selectorstatic <A> com.mojang.serialization.Codec<UniformlyRandomSelector<A>>codec(com.mojang.serialization.Codec<A> codec) Factory for creating an instanced version of this classstatic <T> UniformlyRandomSelector<T>empty()Gets a random elementiterator()static <T> UniformlyRandomSelector<T>static <T> UniformlyRandomSelector<T>of(T... elements) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
values
-
-
Constructor Details
-
UniformlyRandomSelector
-
-
Method Details
-
of
-
of
-
empty
-
getRandom
Description copied from interface:SelectorGets a random element -
iterator
-
codec
public <A> Function<com.mojang.serialization.Codec<A>,com.mojang.serialization.Codec<? extends Selector<A>>> codec()Description copied from interface:SelectorGets the codec for this selector -
codec
public static <A> com.mojang.serialization.Codec<UniformlyRandomSelector<A>> codec(com.mojang.serialization.Codec<A> codec) Factory for creating an instanced version of this class- Type Parameters:
A- The type- Parameters:
codec- The type's codec- Returns:
- The codec for the instanced selector
-