Click or drag to resize
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
C#
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: UInt32
The index of the item picked randomly from the list of probabilities.
See Also