A timer class that alarms when given amount of time has passed.
Inherited by TaleWorlds.MountAndBlade.RandomTimer.
|
| Timer (float gameTime, float duration, bool autoReset=true) |
| Initializes a new instance of the Timer class.
|
|
virtual bool | Check (float gameTime) |
| Checks if the required amount of time has passed or not.
|
|
float | ElapsedTime () |
| Gets the amount of time that has passed since the timer has started for the next alarm.
|
|
void | Reset (float gameTime) |
|
void | Reset (float gameTime, float newDuration) |
|
void | AdjustStartTime (float deltaTime) |
|
|
float | Duration [get, protected set] |
| Duration after which the timer alarms.
|
|
float | PreviousDeltaTime [get] |
| The time elapsed before the alarm rang.
|
|
◆ Timer()
TaleWorlds.Core.Timer.Timer |
( |
float |
gameTime, |
|
|
float |
duration, |
|
|
bool |
autoReset = true |
|
) |
| |
- Parameters
-
gameTime | Current time of the time type that will be used for checking. |
duration | Duration after which the timer alarms. |
autoReset | If the timer should reset after alarming or not. IMPORTANT: If true, it is impossible to check the timer multiple times in a frame (only first check will return true, and then it will reset and return false) |
◆ Check()
virtual bool TaleWorlds.Core.Timer.Check |
( |
float |
gameTime | ) |
|
|
virtual |
- Parameters
-
gameTime | Current time of the time type that is used for checking. |
- Returns
- Returns true if the required amount of time has passed.
Reimplemented in TaleWorlds.MountAndBlade.RandomTimer.
◆ ElapsedTime()
float TaleWorlds.Core.Timer.ElapsedTime |
( |
| ) |
|
- Returns
- The amount of time that has passed since the timer has started for the next alarm.
◆ Reset() [1/2]
void TaleWorlds.Core.Timer.Reset |
( |
float |
gameTime | ) |
|
◆ Reset() [2/2]
void TaleWorlds.Core.Timer.Reset |
( |
float |
gameTime, |
|
|
float |
newDuration |
|
) |
| |
◆ AdjustStartTime()
void TaleWorlds.Core.Timer.AdjustStartTime |
( |
float |
deltaTime | ) |
|
◆ Duration
float TaleWorlds.Core.Timer.Duration |
|
getprotected set |
◆ PreviousDeltaTime
float TaleWorlds.Core.Timer.PreviousDeltaTime |
|
get |