Package com.fs.starfarer.api.util
Class WeightedRandomPicker<T>
java.lang.Object
com.fs.starfarer.api.util.WeightedRandomPicker<T>
- All Implemented Interfaces:
Cloneable
-
Constructor Summary
ConstructorsConstructorDescriptionWeightedRandomPicker
(boolean ignoreWeights) WeightedRandomPicker
(Random random) -
Method Summary
-
Constructor Details
-
WeightedRandomPicker
public WeightedRandomPicker() -
WeightedRandomPicker
public WeightedRandomPicker(boolean ignoreWeights) -
WeightedRandomPicker
-
-
Method Details
-
clone
-
clear
public void clear() -
addAll
-
addAll
-
add
-
add
-
remove
-
isEmpty
public boolean isEmpty() -
getItems
-
getWeight
-
getWeight
public float getWeight(int index) -
setWeight
public void setWeight(int index, float weight) -
getItemWithHighestWeight
-
pickAndRemove
-
pick
-
pick
-
getRandom
-
setRandom
-
print
-
getTotal
public float getTotal()
-