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

RandomTimer class inherits Timer class and adds alarming at random times between minimum and maximum time limits.

Inherits TaleWorlds.Core.Timer.

Public Member Functions

 RandomTimer (float gameTime, float durationMin, float durationMax)
 Initializes a new instance of the RandomTimer class. More...
 
override bool Check (float gameTime)
 Checks if the required amount of time has passed or not. If it has passed, then the new random duration is set for the next alarm. More...
 
void ChangeDuration (float min, float max)
 Sets current min and max duration values and resets timer according to these values. This does not certainly main in next check this timer will tick. But next tick will be related to given min max values. More...
 
void RecomputeDuration ()
 Resets duration value. More...
 
- Public Member Functions inherited from TaleWorlds.Core.Timer
 Timer (float gameTime, float duration, bool autoReset=true)
 Initializes a new instance of the Timer class. More...
 
virtual bool Check (float gameTime)
 Checks if the required amount of time has passed or not. More...
 
float ElapsedTime ()
 Gets the amount of time that has passed since the timer has started for the next alarm. More...
 
void Reset (float gameTime)
 
void Reset (float gameTime, float newDuration)
 
void AdjustStartTime (float deltaTime)
 

Additional Inherited Members

- Properties inherited from TaleWorlds.Core.Timer
float Duration [get, protected set]
 Duration after which the timer alarms. More...
 
float PreviousDeltaTime [get]
 The time elapsed before the alarm rang. More...
 

Constructor & Destructor Documentation

◆ RandomTimer()

TaleWorlds.MountAndBlade.RandomTimer.RandomTimer ( float  gameTime,
float  durationMin,
float  durationMax 
)
Parameters
gameTimeCurrent time of the time type that will be used for checking.
durationMinMinimum duration value for random time selection.
durationMaxMaximum duration value for random time selection.

Member Function Documentation

◆ Check()

override bool TaleWorlds.MountAndBlade.RandomTimer.Check ( float  gameTime)
virtual
Parameters
gameTimeCurrent time of the time type that is used for checking.
Returns
Returns true if the required amount of time has passed.

Reimplemented from TaleWorlds.Core.Timer.

◆ ChangeDuration()

void TaleWorlds.MountAndBlade.RandomTimer.ChangeDuration ( float  min,
float  max 
)

◆ RecomputeDuration()

void TaleWorlds.MountAndBlade.RandomTimer.RecomputeDuration ( )