Class RandomExtensions
- Namespace
- MarymoorStudios.Core
- Assembly
- MarymoorStudios.Core.dll
public static class RandomExtensions
- Inheritance
-
RandomExtensions
- Inherited Members
Methods
NextBool(Random)
Returns a fairly distributed boolean.
public static bool NextBool(this Random rand)
Parameters
rand
Random
Returns
NextEnum<TEnum>(Random)
Returns a uniformly distributed value from chosen enum.
public static TEnum NextEnum<TEnum>(this Random rand) where TEnum : struct, Enum
Parameters
rand
Random
Returns
- TEnum
Type Parameters
TEnum
NextNormal(Random)
Generates two pseudo-random independent variables from a normal distribution.
public static (double Z0, double Z1) NextNormal(this Random rand)
Parameters
rand
RandomRandom source
Returns
NextNormal(Random, double, double)
Generates two pseudo-random independent variables from a normal distribution.
public static (double Z0, double Z1) NextNormal(this Random rand, double mean, double stddev)
Parameters
Returns
NextNormal(Random, TimeSpan, TimeSpan)
Generates two pseudo-random independent variables from a normal distribution.
public static (TimeSpan Z0, TimeSpan Z1) NextNormal(this Random rand, TimeSpan mean, TimeSpan stddev)
Parameters
Returns
NextUInt16(Random, ushort, ushort)
Returns a uniformly distributed (max-inclusive) 16-bit unsigned integer.
public static ushort NextUInt16(this Random rand, ushort min = 0, ushort max = 65535)
Parameters
Returns
NextUInt32(Random, uint, uint)
Returns a uniformly distributed (max-inclusive) 32-bit unsigned integer.
public static uint NextUInt32(this Random rand, uint min = 0, uint max = 4294967295)
Parameters
Returns
NextUInt64(Random)
Returns a uniformly distributed 64-bit unsigned integer.
public static ulong NextUInt64(this Random rand)
Parameters
rand
Random
Returns
NextUInt8(Random, byte, byte)
Returns a uniformly distributed (max-inclusive) 8-bit unsigned integer.
public static byte NextUInt8(this Random rand, byte min = 0, byte max = 255)