Method RandomBoolGenerator
- Namespace
- Gamelogic.Extensions.Algorithms
- Assembly
- Gamelogic.Extensions.dll
RandomBoolGenerator(float)
Makes a generator that returns random boolean values, true with the specified probability.
public static IGenerator<bool> RandomBoolGenerator(float probability)Parameters
- probabilityfloat
- The probability of generating $(true). 
Returns
- IGenerator<bool>
- A new generator. 
Exceptions
- ArgumentException
- probabilitydoes not lie between 0 and 1 (inclusive)
RandomBoolGenerator(float, int)
Makes a generator that returns random boolean values, true with the specified probability.
public static IGenerator<bool> RandomBoolGenerator(float probability, int seed)Parameters
- probabilityfloat
- The probability of generating $(true). 
- seedint
- The seed to use for the random num ber generator. 
Returns
- IGenerator<bool>
- A new generator. 
Exceptions
- ArgumentException
- probabilitydoes not lie between 0 and 1 (inclusive)