Table of Contents

Class RandomNumberGenerator

Namespace
Shift.Common
Assembly
Shift.Common.dll
public class RandomNumberGenerator
Inheritance
RandomNumberGenerator
Inherited Members
Extension Methods

Remarks

Represents a pseudo-random number generator, wrapping Microsoft's implementation in the .NET Framework Random class, so we don't need to worry about seeding the generator in our client code.

Constructors

RandomNumberGenerator()

public RandomNumberGenerator()

Fields

Instance

public static readonly RandomNumberGenerator Instance

Field Value

RandomNumberGenerator

Methods

Next()

public int Next()

Returns

int

Remarks

Returns a random integer between -2147483648 (inclusive) and 2147483647 (exclusive).

Next(int, int)

public int Next(int inclusiveLowerBound, int exclusiveUpperBound)

Parameters

inclusiveLowerBound int
exclusiveUpperBound int

Returns

int

Remarks

Returns a random integer between the lower bound (inclusive) and the upper bound (exclusive). In other words, a series of calls to Next(1,10) will receive values in the range 1..9 (NOT in the range 1..10).