ExtendedMathPickBasedOnProbability Method |
pick a random index based of list of probabilities (array of floats representing chances).
Namespace:
GeonBit.Core.Utils
Assembly:
GeonBit (in GeonBit.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax public static uint PickBasedOnProbability(
float[] probabilities,
Random rand = null
)
Parameters
- probabilities
- Type: SystemSingle
Array of floats representing chance for every index. - rand (Optional)
- Type: SystemRandom
Optional random instance to provide (if null will create new one internally).
Return Value
Type:
UInt32The index of the item picked randomly from the list of probabilities.
See Also