Class Randomico
- Namespace
- Cobilas.GodotEngine.Utility
- Assembly
- com.cobilas.godot.utility.dll
The class allows the creation of pseudo random numbers.
public static class Randomico
- Inheritance
-
Randomico
- Inherited Members
Properties
BooleanRandom
Less than 0.5f
is false, greater than 0.5f
is true.(Randomico.value > 0.5f
)
public static bool BooleanRandom { get; }
Property Value
value
Returns a random number between 0.0 [inclusive] and 1.0 [inclusive] (Read Only).
public static double value { get; }
Property Value
- double
Returns a pseudo-random floating-point number between
0.0
and1.0
.
Methods
ByteList(byte[])
Fills the elements of a specified array of bytes with random numbers.
public static void ByteList(byte[] buffer)
Parameters
buffer
byte[]An array of bytes to contain random numbers.
Exceptions
- ArgumentNullException
buffer is null.
ByteRange()
Return a random integer number between min [0] and max [255] (ReadOnly).
public static byte ByteRange()
Returns
- byte
Returns a pseudo-random number of integer type according to the range defined in the parameters.
ByteRange(byte)
Return a random integer number between min [0] and max [exclusive] (ReadOnly).
public static byte ByteRange(byte max)
Parameters
max
byteDefines the maximum range of the pseudo-random number.
Returns
- byte
Returns a pseudo-random number of integer type according to the range defined in the parameters.
ByteRange(byte, byte)
Return a random integer number between min [inclusive] and max [exclusive] (ReadOnly).
public static byte ByteRange(byte min, byte max)
Parameters
min
byteSets the minimum range of the pseudo-random number.
max
byteDefines the maximum range of the pseudo-random number.
Returns
- byte
Returns a pseudo-random number of integer type according to the range defined in the parameters.
DecimalRange()
Return a random float number between min [-79228162514264337593543950335M] and max [79228162514264337593543950335M] (ReadOnly).
public static decimal DecimalRange()
Returns
- decimal
Returns a pseudo-random floating-point number according to the range defined in the parameters.
DecimalRange(decimal)
Return a random float number between min [-79228162514264337593543950335M] and max [exclusive] (ReadOnly).
public static decimal DecimalRange(decimal max)
Parameters
max
decimalDefines the maximum range of the pseudo-random number.
Returns
- decimal
Returns a pseudo-random floating-point number according to the range defined in the parameters.
DecimalRange(decimal, decimal)
Return a random float number between min [inclusive] and max [exclusive] (ReadOnly).
public static decimal DecimalRange(decimal min, decimal max)
Parameters
min
decimalSets the minimum range of the pseudo-random number.
max
decimalDefines the maximum range of the pseudo-random number.
Returns
- decimal
Returns a pseudo-random floating-point number according to the range defined in the parameters.
DoubleRange()
Return a random float number between min [-1.7976931348623157E+308] and max [1.7976931348623157E+308] (ReadOnly).
public static double DoubleRange()
Returns
- double
Returns a pseudo-random floating-point number according to the range defined in the parameters.
DoubleRange(double)
Return a random float number between min [-1.7976931348623157E+308] and max [exclusive] (ReadOnly).
public static double DoubleRange(double max)
Parameters
max
doubleDefines the maximum range of the pseudo-random number.
Returns
- double
Returns a pseudo-random floating-point number according to the range defined in the parameters.
DoubleRange(double, double)
Return a random float number between min [inclusive] and max [exclusive] (ReadOnly).
public static double DoubleRange(double min, double max)
Parameters
min
doubleSets the minimum range of the pseudo-random number.
max
doubleDefines the maximum range of the pseudo-random number.
Returns
- double
Returns a pseudo-random floating-point number according to the range defined in the parameters.
FloatRange()
Return a random float number between min [-3.4028235E+38F] and max [3.4028235E+38F] (ReadOnly).
public static float FloatRange()
Returns
- float
Returns a pseudo-random floating-point number according to the range defined in the parameters.
FloatRange(float)
Return a random float number between min [-3.4028235E+38F] and max [exclusive] (ReadOnly).
public static float FloatRange(float max)
Parameters
max
floatDefines the maximum range of the pseudo-random number.
Returns
- float
Returns a pseudo-random floating-point number according to the range defined in the parameters.
FloatRange(float, float)
Return a random float number between min [inclusive] and max [exclusive] (ReadOnly).
public static float FloatRange(float min, float max)
Parameters
min
floatSets the minimum range of the pseudo-random number.
max
floatDefines the maximum range of the pseudo-random number.
Returns
- float
Returns a pseudo-random floating-point number according to the range defined in the parameters.
InitSeed(in int)
Starts a new seed in the pseudo-random number generator.
public static void InitSeed(in int seed)
Parameters
seed
intA 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.
IntRange()
Return a random integer number between min [-2147483648] and max [2147483647] (ReadOnly).
public static int IntRange()
Returns
- int
Returns a pseudo-random number of integer type according to the range defined in the parameters.
IntRange(int)
Return a random integer number between min [-2147483648] and max [exclusive] (ReadOnly).
public static int IntRange(int max)
Parameters
max
intDefines the maximum range of the pseudo-random number.
Returns
- int
Returns a pseudo-random number of integer type according to the range defined in the parameters.
IntRange(int, int)
Return a random integer number between min [inclusive] and max [exclusive] (ReadOnly).
public static int IntRange(int min, int max)
Parameters
min
intSets the minimum range of the pseudo-random number.
max
intDefines the maximum range of the pseudo-random number.
Returns
- int
Returns a pseudo-random number of integer type according to the range defined in the parameters.
LongRange()
Return a random integer number between min [-9223372036854775808] and max [9223372036854775807] (ReadOnly).
public static long LongRange()
Returns
- long
Returns a pseudo-random number of integer type according to the range defined in the parameters.
LongRange(long)
Return a random integer number between min [-9223372036854775808] and max [exclusive] (ReadOnly).
public static long LongRange(long max)
Parameters
max
longDefines the maximum range of the pseudo-random number.
Returns
- long
Returns a pseudo-random number of integer type according to the range defined in the parameters.
LongRange(long, long)
Return a random integer number between min [inclusive] and max [exclusive] (ReadOnly).
public static long LongRange(long min, long max)
Parameters
min
longSets the minimum range of the pseudo-random number.
max
longDefines the maximum range of the pseudo-random number.
Returns
- long
Returns a pseudo-random number of integer type according to the range defined in the parameters.
SByteRange()
Return a random integer number between min [-128] and max [127] (ReadOnly).
public static sbyte SByteRange()
Returns
- sbyte
Returns a pseudo-random number of integer type according to the range defined in the parameters.
SByteRange(sbyte)
Return a random integer number between min [-128] and max [exclusive] (ReadOnly).
public static sbyte SByteRange(sbyte max)
Parameters
max
sbyteDefines the maximum range of the pseudo-random number.
Returns
- sbyte
Returns a pseudo-random number of integer type according to the range defined in the parameters.
SByteRange(sbyte, sbyte)
Return a random integer number between min [inclusive] and max [exclusive] (ReadOnly).
public static sbyte SByteRange(sbyte min, sbyte max)
Parameters
min
sbyteSets the minimum range of the pseudo-random number.
max
sbyteDefines the maximum range of the pseudo-random number.
Returns
- sbyte
Returns a pseudo-random number of integer type according to the range defined in the parameters.
ShortRange()
Return a random integer number between min [-32768] and max [32767] (ReadOnly).
public static short ShortRange()
Returns
- short
Returns a pseudo-random number of integer type according to the range defined in the parameters.
ShortRange(short)
Return a random integer number between min [-32768] and max [exclusive] (ReadOnly).
public static short ShortRange(short max)
Parameters
max
shortDefines the maximum range of the pseudo-random number.
Returns
- short
Returns a pseudo-random number of integer type according to the range defined in the parameters.
ShortRange(short, short)
Return a random integer number between min [inclusive] and max [exclusive] (ReadOnly).
public static short ShortRange(short min, short max)
Parameters
min
shortSets the minimum range of the pseudo-random number.
max
shortDefines the maximum range of the pseudo-random number.
Returns
- short
Returns a pseudo-random number of integer type according to the range defined in the parameters.
ULongRange()
Return a random integer number between min [0] and max [18446744073709551615] (ReadOnly).
public static ulong ULongRange()
Returns
- ulong
Returns a pseudo-random number of integer type according to the range defined in the parameters.
ULongRange(ulong)
Return a random integer number between min [0] and max [exclusive] (ReadOnly).
public static ulong ULongRange(ulong max)
Parameters
max
ulongDefines the maximum range of the pseudo-random number.
Returns
- ulong
Returns a pseudo-random number of integer type according to the range defined in the parameters.
ULongRange(ulong, ulong)
Return a random integer number between min [inclusive] and max [exclusive] (ReadOnly).
public static ulong ULongRange(ulong min, ulong max)
Parameters
min
ulongSets the minimum range of the pseudo-random number.
max
ulongDefines the maximum range of the pseudo-random number.
Returns
- ulong
Returns a pseudo-random number of integer type according to the range defined in the parameters.
UShortRange()
Return a random integer number between min [0] and max [65535] (ReadOnly).
public static ushort UShortRange()
Returns
- ushort
Returns a pseudo-random number of integer type according to the range defined in the parameters.
UShortRange(ushort)
Return a random integer number between min [0] and max [exclusive] (ReadOnly).
public static ushort UShortRange(ushort max)
Parameters
max
ushortDefines the maximum range of the pseudo-random number.
Returns
- ushort
Returns a pseudo-random number of integer type according to the range defined in the parameters.
UShortRange(ushort, ushort)
Return a random integer number between min [inclusive] and max [exclusive] (ReadOnly).
public static ushort UShortRange(ushort min, ushort max)
Parameters
min
ushortSets the minimum range of the pseudo-random number.
max
ushortDefines the maximum range of the pseudo-random number.
Returns
- ushort
Returns a pseudo-random number of integer type according to the range defined in the parameters.