M&B: Bannerlord 1.0.0
The horns sound, the ravens gather.
Loading...
Searching...
No Matches
TaleWorlds.Core.MBRandom Class Reference

Static Public Member Functions

static float RandomFloatRanged (float maxVal)
 
static float RandomFloatRanged (float minVal, float maxVal)
 
static int RandomInt ()
 
static int RandomInt (int maxValue)
 Returns a non-negative random integer that is less than the specified maximum. More...
 
static int RandomInt (int minValue, int maxValue)
 
static int RoundRandomized (float f)
 
static T ChooseWeighted< T > (List< ValueTuple< T, float > > weightList)
 This function only works if w is bigger than 0 More...
 
static T ChooseWeighted< T > (List< ValueTuple< T, float > > weightList, out int chosenIndex)
 
static int RandomIntWithSeed (uint seed1, uint seed4=MBFastRandom.DefaultSeedW, uint seed2=MBFastRandom.DefaultSeedY, uint seed3=MBFastRandom.DefaultSeedZ)
 Returns a non-negative random integer with seed. More...
 
static float RandomFloatWithSeed (uint seed1, uint seed4=MBFastRandom.DefaultSeedW, uint seed2=MBFastRandom.DefaultSeedY, uint seed3=MBFastRandom.DefaultSeedZ)
 Returns a random float with seed that is greater than or equal to 0.0, and less than 1.0 with Seed. More...
 

Static Public Attributes

const int MaxSeed = 2000
 

Properties

static float RandomFloat [get]
 Returns a random number between 0.0 and 1.0 (exclusive). More...
 
static float RandomFloatNormal [get]
 Returns a random number with normal distribution between -1.0 and 1.0 More...
 
static float NondeterministicRandomFloat [get]
 Returns Nondeterministic a random number between 0.0 and 1.0 (exclusive). More...
 
static int NondeterministicRandomInt [get]
 Returns Nondeterministic a random number between 0 and int.max. More...
 

Member Function Documentation

◆ RandomFloatRanged() [1/2]

static float TaleWorlds.Core.MBRandom.RandomFloatRanged ( float  maxVal)
static

◆ RandomFloatRanged() [2/2]

static float TaleWorlds.Core.MBRandom.RandomFloatRanged ( float  minVal,
float  maxVal 
)
static

◆ RandomInt() [1/3]

static int TaleWorlds.Core.MBRandom.RandomInt ( )
static

◆ RandomInt() [2/3]

static int TaleWorlds.Core.MBRandom.RandomInt ( int  maxValue)
static

◆ RandomInt() [3/3]

static int TaleWorlds.Core.MBRandom.RandomInt ( int  minValue,
int  maxValue 
)
static

◆ RoundRandomized()

static int TaleWorlds.Core.MBRandom.RoundRandomized ( float  f)
static

◆ ChooseWeighted< T >() [1/2]

static T TaleWorlds.Core.MBRandom.ChooseWeighted< T > ( List< ValueTuple< T, float > >  weightList)
static

◆ ChooseWeighted< T >() [2/2]

static T TaleWorlds.Core.MBRandom.ChooseWeighted< T > ( List< ValueTuple< T, float > >  weightList,
out int  chosenIndex 
)
static

◆ RandomIntWithSeed()

static int TaleWorlds.Core.MBRandom.RandomIntWithSeed ( uint  seed1,
uint  seed4 = MBFastRandom.DefaultSeedW,
uint  seed2 = MBFastRandom.DefaultSeedY,
uint  seed3 = MBFastRandom.DefaultSeedZ 
)
static

◆ RandomFloatWithSeed()

static float TaleWorlds.Core.MBRandom.RandomFloatWithSeed ( uint  seed1,
uint  seed4 = MBFastRandom.DefaultSeedW,
uint  seed2 = MBFastRandom.DefaultSeedY,
uint  seed3 = MBFastRandom.DefaultSeedZ 
)
static

Member Data Documentation

◆ MaxSeed

const int TaleWorlds.Core.MBRandom.MaxSeed = 2000
static

Property Documentation

◆ RandomFloat

float TaleWorlds.Core.MBRandom.RandomFloat
staticget

◆ RandomFloatNormal

float TaleWorlds.Core.MBRandom.RandomFloatNormal
staticget

◆ NondeterministicRandomFloat

float TaleWorlds.Core.MBRandom.NondeterministicRandomFloat
staticget

◆ NondeterministicRandomInt

int TaleWorlds.Core.MBRandom.NondeterministicRandomInt
staticget