Random generator for boolean values.
More...
|
static bool | Chance (float chances, float maxChances) |
| Calculates "chance" out of "max chances". Example: 1 chance out of 3 chances (or 33.3%) More...
|
|
static bool | NextBoolean () |
| Generates a random boolean value. More...
|
|
|
static readonly System.Random | _random = new System.Random() |
|
Random generator for boolean values.
var value1 = RandomBoolean.NextBoolean();
var value2 = RandomBoolean.Chance(1,3);
◆ Chance()
static bool PipServices3.Commons.Random.RandomBoolean.Chance |
( |
float |
chances, |
|
|
float |
maxChances |
|
) |
| |
|
static |
Calculates "chance" out of "max chances". Example: 1 chance out of 3 chances (or 33.3%)
- Parameters
-
chances | a chance proportional to maxChances. |
maxChances | a maximum number of chances |
- Returns
- random boolean value.
◆ NextBoolean()
static bool PipServices3.Commons.Random.RandomBoolean.NextBoolean |
( |
| ) |
|
|
static |
Generates a random boolean value.
- Returns
- random boolean value.
The documentation for this class was generated from the following file:
- src/Random/RandomBoolean.cs