Table of Contents

Class MBRandom

Namespace
TaleWorlds.Core
Assembly
TaleWorlds.Core.dll
public static class MBRandom
Inheritance
MBRandom
Inherited Members

Fields

MaxSeed

public const int MaxSeed = 2000

Field Value

int

Properties

NondeterministicRandomFloat

public static float NondeterministicRandomFloat { get; }

Property Value

float

NondeterministicRandomInt

public static int NondeterministicRandomInt { get; }

Property Value

int

RandomFloat

public static float RandomFloat { get; }

Property Value

float

RandomFloatNormal

public static float RandomFloatNormal { get; }

Property Value

float

Methods

ChooseWeighted<T>(IReadOnlyList<(T, float)>)

public static T ChooseWeighted<T>(IReadOnlyList<(T, float)> weightList)

Parameters

weightList IReadOnlyList<(T, float)>

Returns

T

Type Parameters

T

ChooseWeighted<T>(IReadOnlyList<(T, float)>, out int)

public static T ChooseWeighted<T>(IReadOnlyList<(T, float)> weightList, out int chosenIndex)

Parameters

weightList IReadOnlyList<(T, float)>
chosenIndex int

Returns

T

Type Parameters

T

RandomFloatRanged(float)

public static float RandomFloatRanged(float maxVal)

Parameters

maxVal float

Returns

float

RandomFloatRanged(float, float)

public static float RandomFloatRanged(float minVal, float maxVal)

Parameters

minVal float
maxVal float

Returns

float

RandomFloatWithSeed(uint, uint)

public static float RandomFloatWithSeed(uint seed, uint seed2)

Parameters

seed uint
seed2 uint

Returns

float

RandomInt()

public static int RandomInt()

Returns

int

RandomInt(int)

public static int RandomInt(int maxValue)

Parameters

maxValue int

Returns

int

RandomInt(int, int)

public static int RandomInt(int minValue, int maxValue)

Parameters

minValue int
maxValue int

Returns

int

RandomIntWithSeed(uint, uint)

public static int RandomIntWithSeed(uint seed, uint seed2)

Parameters

seed uint
seed2 uint

Returns

int

RoundRandomized(float)

public static int RoundRandomized(float f)

Parameters

f float

Returns

int

SetSeed(uint, uint)

public static void SetSeed(uint seed, uint seed2)

Parameters

seed uint
seed2 uint

This page was last modified at 09/01/2024 16:12:00 +00:00 (UTC).