Class RandomAdaptor
Adapter to utilize a IRandomProvider with System.Random based systems, wrapping the provider in a class object with expected overrides.
Inheritance
System.Object
System.Random
RandomAdaptor
Inherited Members
System.Random.NextBytes(System.Span<System.Byte>)
Namespace: GDX.Mathematics.Random
Syntax
[VisualScriptingCompatible((short)4)]
public class RandomAdaptor : Random
Remarks
This will create IL callvert
operation codes! Try not to use this.
Constructors
| Improve this Doc View SourceRandomAdaptor(IRandomProvider)
Create an adaptor object which behaves like System.Random.
Declaration
public RandomAdaptor(IRandomProvider provider)
Parameters
Type | Name | Description |
---|---|---|
IRandomProvider | provider | A qualified IRandomProvider. |
Remarks
Will cause boxing of langword_csharp_struct based types like WELL1024a. This adaptor really should only be used where a method is expecting a System.Random.
Methods
| Improve this Doc View SourceHasProvider()
Is the provider present, and not null?
Declaration
public bool HasProvider()
Returns
Type | Description |
---|---|
System.Boolean | true/false a provider is not null. |
Next()
Declaration
public override int Next()
Returns
Type | Description |
---|---|
System.Int32 |
Overrides
System.Random.Next()
|
Improve this Doc
View Source
Next(Int32)
Declaration
public override int Next(int maxValue)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | maxValue |
Returns
Type | Description |
---|---|
System.Int32 |
Overrides
System.Random.Next(System.Int32)
|
Improve this Doc
View Source
Next(Int32, Int32)
Declaration
public override int Next(int minValue, int maxValue)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | minValue | |
System.Int32 | maxValue |
Returns
Type | Description |
---|---|
System.Int32 |
Overrides
System.Random.Next(System.Int32, System.Int32)
|
Improve this Doc
View Source
NextBytes(Byte[])
Declaration
public override void NextBytes(byte[] buffer)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | buffer |
Overrides
System.Random.NextBytes(System.Byte[])
|
Improve this Doc
View Source
NextDouble()
Declaration
public override double NextDouble()
Returns
Type | Description |
---|---|
System.Double |
Overrides
System.Random.NextDouble()
|
Improve this Doc
View Source
Sample()
Declaration
protected override double Sample()
Returns
Type | Description |
---|---|
System.Double |
Overrides
System.Random.Sample()