Swiss Army Knife
General utility tools for Scada Minds
Static Public Member Functions | List of all members
RandomExtensions Class Reference

Extensions to make working with the BCL Random class a little less painful. Includes methods to get a bunch of different types. More...

Static Public Member Functions

static double NextDouble (this Random @this, double minValue, double maxValue)
 Returns a double within the range [minValue..maxValue) (minValue inclusive, maxValue exclusive) Based on this. More...
 
static bool NextBoolean (this Random @this)
 Returns a random boolean. There's a 50/50 chance of each. More...
 
static byte NextByte (this Random @this)
 Returns a random byte. Can be from the range [0..byte.maxValue] (both inclusive). More...
 
static T Choice< T > (this Random @this, IEnumerable< T > enumerable)
 Selects one specific item from an Enumerable. There's an equal chance it will select each item. More...
 

Detailed Description

Extensions to make working with the BCL Random class a little less painful. Includes methods to get a bunch of different types.

Member Function Documentation

◆ Choice< T >()

static T Choice< T > ( this Random @  this,
IEnumerable< T >  enumerable 
)
inlinestatic

Selects one specific item from an Enumerable. There's an equal chance it will select each item.

◆ NextBoolean()

static bool NextBoolean ( this Random @  this)
inlinestatic

Returns a random boolean. There's a 50/50 chance of each.

◆ NextByte()

static byte NextByte ( this Random @  this)
inlinestatic

Returns a random byte. Can be from the range [0..byte.maxValue] (both inclusive).

◆ NextDouble()

static double NextDouble ( this Random @  this,
double  minValue,
double  maxValue 
)
inlinestatic

Returns a double within the range [minValue..maxValue) (minValue inclusive, maxValue exclusive) Based on this.


The documentation for this class was generated from the following file: