Kerbal Space Program  1.12.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
Public Member Functions | Protected Member Functions | List of all members
KSPRandom Class Reference

Represents a pseudo-random number generator, which is a device that produces a sequence of numbers that meet certain statistical requirements for randomness.To browse the .NET Framework source code for this type, see the Reference Source. More...

Inheritance diagram for KSPRandom:

Public Member Functions

 KSPRandom ()
 Initializes a new instance of the T:System.Random class, using a time-dependent default seed value. More...
 
 KSPRandom (int Seed)
 Initializes a new instance of the T:System.Random class, using the specified seed value. More...
 
virtual new int Next ()
 Returns a non-negative random integer. More...
 
virtual new int Next (int maxValue)
 Returns a non-negative random integer that is less than the specified maximum. More...
 
virtual new int Next (int minValue, int maxValue)
 Returns a random integer that is within a specified range. More...
 
virtual new void NextBytes (byte[] buffer)
 Fills the elements of a specified array of bytes with random numbers. More...
 
virtual new double NextDouble ()
 Returns a random floating-point number that is greater than or equal to 0.0, and less than 1.0. More...
 
virtual double NextDouble (double minValue, double maxValue)
 Returns a random double that is within a specified range. More...
 

Protected Member Functions

virtual new double Sample ()
 Returns a random floating-point number between 0.0 and 1.0. More...
 

Detailed Description

Represents a pseudo-random number generator, which is a device that produces a sequence of numbers that meet certain statistical requirements for randomness.To browse the .NET Framework source code for this type, see the Reference Source.

Constructor & Destructor Documentation

KSPRandom.KSPRandom ( )
inline

Initializes a new instance of the T:System.Random class, using a time-dependent default seed value.

KSPRandom.KSPRandom ( int  Seed)
inline

Initializes a new instance of the T:System.Random class, using the specified seed value.

Parameters
SeedA number used to calculate a starting value for the pseudo-random number sequence. If a negative number is specified, the absolute value of the number is used.

Member Function Documentation

virtual new int KSPRandom.Next ( )
inlinevirtual

Returns a non-negative random integer.

Returns
A 32-bit signed integer that is greater than or equal to 0 and less than F:System.Int32.MaxValue.
virtual new int KSPRandom.Next ( int  maxValue)
inlinevirtual

Returns a non-negative random integer that is less than the specified maximum.

Parameters
maxValueThe exclusive upper bound of the random number to be generated. maxValue must be greater than or equal to 0.
Returns
A 32-bit signed integer that is greater than or equal to 0, and less than maxValue ; that is, the range of return values ordinarily includes 0 but not maxValue . However, if maxValue equals 0, maxValue is returned.
Exceptions
T:System.ArgumentOutOfRangeExceptionmaxValue is less than 0.
virtual new int KSPRandom.Next ( int  minValue,
int  maxValue 
)
inlinevirtual

Returns a random integer that is within a specified range.

Parameters
minValueThe inclusive lower bound of the random number returned.
maxValueThe exclusive upper bound of the random number returned. maxValue must be greater than or equal to minValue .
Returns
A 32-bit signed integer greater than or equal to minValue and less than maxValue ; that is, the range of return values includes minValue but not maxValue . If minValue equals maxValue , minValue is returned.
Exceptions
T:System.ArgumentOutOfRangeExceptionminValue is greater than maxValue .
virtual new void KSPRandom.NextBytes ( byte[]  buffer)
inlinevirtual

Fills the elements of a specified array of bytes with random numbers.

Parameters
bufferAn array of bytes to contain random numbers.
Exceptions
T:System.ArgumentNullExceptionbuffer is .
virtual new double KSPRandom.NextDouble ( )
inlinevirtual

Returns a random floating-point number that is greater than or equal to 0.0, and less than 1.0.

Returns
A double-precision floating point number that is greater than or equal to 0.0, and less than 1.0.
virtual double KSPRandom.NextDouble ( double  minValue,
double  maxValue 
)
inlinevirtual

Returns a random double that is within a specified range.

Parameters
minValueThe inclusive lower bound of the random number returned.
maxValueThe exclusive upper bound of the random number returned. maxValue must be greater than or equal to minValue .
Returns
A 32-bit signed integer greater than or equal to minValue and less than maxValue ; that is, the range of return values includes minValue but not maxValue . If minValue equals maxValue , minValue is returned.
Exceptions
T:System.ArgumentOutOfRangeExceptionminValue is greater than maxValue .
virtual new double KSPRandom.Sample ( )
inlineprotectedvirtual

Returns a random floating-point number between 0.0 and 1.0.

Returns
A double-precision floating point number that is greater than or equal to 0.0, and less than 1.0.

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