Show / Hide Table of Contents

Class DFRandom

Reimplementing key parts of Daggerfall's random library. This ensures critical random number sequences (e.g. building names) will match Daggerfall's output across all platforms.

Inheritance
Object
DFRandom
Namespace: DaggerfallWorkshop
Assembly: Assembly-CSharp.dll
Syntax
public static class DFRandom

Properties

| Improve this Doc View Source

Seed

Declaration
public static uint Seed { get; set; }
Property Value
Type Description
UInt32

Methods

| Improve this Doc View Source

rand()

Generate a random number.

Declaration
public static uint rand()
Returns
Type Description
UInt32
| Improve this Doc View Source

random_range(Int32)

Generates a random number between 0 and max (exclusive).

Declaration
public static int random_range(int max)
Parameters
Type Name Description
Int32 max

Maximum number (exclusive).

Returns
Type Description
Int32

Random number between 0 and max - 1.

| Improve this Doc View Source

random_range(Int32, Int32)

Generates a random number between min and max (exclusive).

Declaration
public static int random_range(int min, int max)
Parameters
Type Name Description
Int32 min

Minimum number.

Int32 max

Maximum number (exclusive).

Returns
Type Description
Int32

Random number between min and max - 1.

| Improve this Doc View Source

random_range_inclusive(Int32, Int32)

Generates a random number between min and max (inclusive).

Declaration
public static int random_range_inclusive(int min, int max)
Parameters
Type Name Description
Int32 min

Minimum number.

Int32 max

Maximum number (inclusive).

Returns
Type Description
Int32

Random number between min and max - 1.

| Improve this Doc View Source

RestoreSeed()

Declaration
public static void RestoreSeed()
| Improve this Doc View Source

SaveSeed()

Declaration
public static void SaveSeed()
| Improve this Doc View Source

srand(Int32)

Seed random generator.

Declaration
public static void srand(int seed)
Parameters
Type Name Description
Int32 seed

Seed int.

| Improve this Doc View Source

srand(UInt32)

Seed random generator.

Declaration
public static void srand(uint seed)
Parameters
Type Name Description
UInt32 seed

Seed uint.

  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX