Interface ItemRandomizer.RandomItem<T>
- Type Parameters:
T- the type being wrapped
- Enclosing interface:
ItemRandomizer<T>
public static interface ItemRandomizer.RandomItem<T>
Wraps an item for usage in the ItemRandomizer.
For instances use the
randomItem(Object, int) factory method.-
Method Summary
Modifier and TypeMethodDescriptionenabled()item()static <T> ItemRandomizer.RandomItem<T> randomItem(T item, int weight) Instantiates a newItemRandomizer.RandomIteminstance.weight()
-
Method Details
-
weight
- Returns:
- the weight assigned to this item
-
enabled
State enabled()- Returns:
- the enabled state
-
item
T item()- Returns:
- the item this random item represents
-
randomItem
Instantiates a newItemRandomizer.RandomIteminstance.- Type Parameters:
T- the item type- Parameters:
item- the itemweight- the random selection weight to assign to this item- Returns:
- a new
ItemRandomizer.RandomIteminstance.
-