public class WeightedRandom extends Object
Constructor and Description |
---|
WeightedRandom() |
Modifier and Type | Method and Description |
---|---|
static WeightedRandomItem |
getRandomItem(Random par0Random,
Collection par1Collection)
Returns a random choice from the input items.
|
static WeightedRandomItem |
getRandomItem(Random par0Random,
Collection par1Collection,
int par2)
Returns a random choice from the input items, with a total weight value.
|
static WeightedRandomItem |
getRandomItem(Random par0Random,
WeightedRandomItem[] par1ArrayOfWeightedRandomItem)
Returns a random choice from the input items.
|
static WeightedRandomItem |
getRandomItem(Random par0Random,
WeightedRandomItem[] par1ArrayOfWeightedRandomItem,
int par2)
Returns a random choice from the input array of items, with a total weight value.
|
static int |
getTotalWeight(Collection par0Collection)
Returns the total weight of all items in a collection.
|
static int |
getTotalWeight(WeightedRandomItem[] par0ArrayOfWeightedRandomItem)
Returns the total weight of all items in a array.
|
public static int getTotalWeight(Collection par0Collection)
public static WeightedRandomItem getRandomItem(Random par0Random, Collection par1Collection, int par2)
public static WeightedRandomItem getRandomItem(Random par0Random, Collection par1Collection)
public static int getTotalWeight(WeightedRandomItem[] par0ArrayOfWeightedRandomItem)
public static WeightedRandomItem getRandomItem(Random par0Random, WeightedRandomItem[] par1ArrayOfWeightedRandomItem, int par2)
public static WeightedRandomItem getRandomItem(Random par0Random, WeightedRandomItem[] par1ArrayOfWeightedRandomItem)