Class RandomExtensions
Inheritance
System.Object
RandomExtensions
Assembly: Eco.Shared.dll
Syntax
public static class RandomExtensions : Object
Methods
Chance(Random, Double)
Declaration
public static bool Chance(this Random random, double chance)
Parameters
| Type |
Name |
Description |
| System.Random |
random |
|
| System.Double |
chance |
|
Returns
| Type |
Description |
| System.Boolean |
|
CoinToss(Random)
Declaration
public static bool CoinToss(this Random random)
Parameters
| Type |
Name |
Description |
| System.Random |
random |
|
Returns
| Type |
Description |
| System.Boolean |
|
Random(Random, Vector2i)
Returns new Vector2i with x greater or equal to 0 and less than max.x. Same for y.
Declaration
public static Vector2i Random(this Random random, Vector2i max)
Parameters
| Type |
Name |
Description |
| System.Random |
random |
|
| Vector2i |
max |
|
Returns
Range(Random, Range)
Declaration
public static double Range(this Random randomizer, Range range)
Parameters
| Type |
Name |
Description |
| System.Random |
randomizer |
|
| Range |
range |
|
Returns
| Type |
Description |
| System.Double |
|
Range(Random, Double, Double)
Declaration
public static double Range(this Random random, double x, double y)
Parameters
| Type |
Name |
Description |
| System.Random |
random |
|
| System.Double |
x |
|
| System.Double |
y |
|
Returns
| Type |
Description |
| System.Double |
|
Shuffle<T>(Random, T[])
Shuffles array elements in-place in random order using random generator.
Declaration
public static void Shuffle<T>(this Random random, T[] array)
Parameters
| Type |
Name |
Description |
| System.Random |
random |
|
| T[] |
array |
|
Type Parameters