Show / Hide Table of Contents

Class RandomExtensions

Extensions for the Random class.

Inheritance
object
RandomExtensions
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: TheXDS.MCART.Types.Extensions
Assembly: MCART.dll
Syntax
public static class RandomExtensions

Properties

| Edit this page View Source

Rnd

Ensures that functions requiring random numbers don't generate Random objects with the same time-based seed.

Declaration
public static Random Rnd { get; }
Property Value
Type Description
Random

Methods

| Edit this page View Source

CoinFlip(Random)

Gets a random value of true or false.

Declaration
public static bool CoinFlip(this Random r)
Parameters
Type Name Description
Random r

Instance of the Random object to use.

Returns
Type Description
bool

true or false randomly.

| Edit this page View Source

Next(Random, in Range<int>)

Returns a random integer within the specified range.

Declaration
public static int Next(this Random r, in Range<int> range)
Parameters
Type Name Description
Random r

Instance of the Random object to use.

Range<int> range

Range<T> of numbers to select from.

Returns
Type Description
int

A random integer within the specified range.

| Edit this page View Source

RndText(Random, in int)

Gets a random text string.

Declaration
public static string RndText(this Random r, in int length)
Parameters
Type Name Description
Random r

Instance of the Random object to use.

int length

Length of the string to generate.

Returns
Type Description
string

A random text string with the specified length.

  • Edit this page
  • View Source
In this article
Back to top Generated by DocFX