Table of Contents

Class RandomGm

Namespace
Gamem
Assembly
Gamem.dll

Provides general-purpose static mathematical functions including interpolation and random number generation.

public static class RandomGm
Inheritance
RandomGm
Inherited Members

Methods

RandomAngleDegrees()

Generates a random angle number in degrees (0 - 360)

public static int RandomAngleDegrees()

Returns

int

A random angle number in degrees (0 - 360)

RandomAngleDegreesDouble()

Generates a random angle number in degrees (0.0 - 360.0)

public static double RandomAngleDegreesDouble()

Returns

double

A random angle number in degrees (0.0 - 360.0)

RandomAngleDegreesFloat()

Generates a random angle number in degrees (0.0 - 360.0)

public static float RandomAngleDegreesFloat()

Returns

float

A random angle number in degrees (0.0 - 360.0)

RandomAngleRadians()

Generates a random angle number in radians (0.0 - 6.28)

public static float RandomAngleRadians()

Returns

float

A random angle number in degrees (0.0 - 6.28)

RandomAngleRadiansDouble()

Generates a random angle number in radians (0.0 - 6.28)

public static double RandomAngleRadiansDouble()

Returns

double

A random angle number in degrees (0.0 - 6.28)

RandomBool()

Generates random bool value (true or false)

public static bool RandomBool()

Returns

bool

Randomly true or false

RandomRange(double, double)

Generates a random floating-point value within a specified inclusive range.

public static double RandomRange(double min, double max)

Parameters

min double

The minimum bound of the range.

max double

The maximum bound of the range.

Returns

double

A random value greater than or equal to min, and less than max.

RandomRange(float, float)

Generates a random floating-point value within a specified inclusive range.

public static float RandomRange(float min, float max)

Parameters

min float

The minimum bound of the range.

max float

The maximum bound of the range.

Returns

float

A random value greater than or equal to min, and less than max.

RandomSign()

Generates a random sign (-1 or 1) so your number can turn into positive or negative

public static int RandomSign()

Returns

int

A random sign (-1 or 1)

RollChance(double)

Evaluates a percentage-based chance to determine a success outcome using a double-precision floating-point value.

public static bool RollChance(double chance)

Parameters

chance double

The success probability as a percentage (e.g., 75.5 for a 75.5% chance).

Returns

bool

true if the random roll succeeds; otherwise, false.

RollChance(int)

Evaluates a percentage-based chance to determine a success outcome using an integer value.

public static bool RollChance(int chance)

Parameters

chance int

The success probability as an integer percentage (e.g., 50 for a 50% chance).

Returns

bool

true if the random roll succeeds; otherwise, false.

RollChance(float)

Evaluates a percentage-based chance to determine a success outcome using a single-precision floating-point value.

public static bool RollChance(float chance)

Parameters

chance float

The success probability as a percentage (e.g., 12.3f for a 12.3% chance).

Returns

bool

true if the random roll succeeds; otherwise, false.