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 Details

    • weight

      Value<Integer> 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

      static <T> ItemRandomizer.RandomItem<T> randomItem(T item, int weight)
      Instantiates a new ItemRandomizer.RandomItem instance.
      Type Parameters:
      T - the item type
      Parameters:
      item - the item
      weight - the random selection weight to assign to this item
      Returns:
      a new ItemRandomizer.RandomItem instance.