RandomNumberGenerator class
This is the default implementation of IRandomNumberGenerator that simply calls Math.random().
Constructors
(constructor)(service |
Constructs a new instance of the |
Properties
service |
The service key for IRandomNumberGenerator. |
Methods
generate() | Returns a pseudorandom number between 0 (inclusive) and 1 (exclusive), following the contract of Math.random(). |
Constructor Details
(constructor)(serviceScope)
Constructs a new instance of the RandomNumberGenerator
class
constructor(serviceScope: ServiceScope);
Parameters
- serviceScope
- ServiceScope
Property Details
serviceKey
The service key for IRandomNumberGenerator.
static readonly serviceKey: ServiceKey<IRandomNumberGenerator>;
Property Value
Method Details
generate()
Returns a pseudorandom number between 0 (inclusive) and 1 (exclusive), following the contract of Math.random().
generate(): number;
Returns
number