net.minecraft.util
Class WeightedRandom

java.lang.Object
  extended by net.minecraft.util.WeightedRandom

public class WeightedRandom
extends Object


Constructor Summary
WeightedRandom()
           
 
Method Summary
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.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WeightedRandom

public WeightedRandom()
Method Detail

getTotalWeight

public static int getTotalWeight(Collection par0Collection)
Returns the total weight of all items in a collection.


getRandomItem

public static WeightedRandomItem getRandomItem(Random par0Random,
                                               Collection par1Collection,
                                               int par2)
Returns a random choice from the input items, with a total weight value.


getRandomItem

public static WeightedRandomItem getRandomItem(Random par0Random,
                                               Collection par1Collection)
Returns a random choice from the input items.


getTotalWeight

public static int getTotalWeight(WeightedRandomItem[] par0ArrayOfWeightedRandomItem)
Returns the total weight of all items in a array.


getRandomItem

public static WeightedRandomItem getRandomItem(Random par0Random,
                                               WeightedRandomItem[] par1ArrayOfWeightedRandomItem,
                                               int par2)
Returns a random choice from the input array of items, with a total weight value.


getRandomItem

public static WeightedRandomItem getRandomItem(Random par0Random,
                                               WeightedRandomItem[] par1ArrayOfWeightedRandomItem)
Returns a random choice from the input items.