![]() |
Murl Engine Lua Addon API
Version 1.0 beta
|
The ITimeframe interface.
The timeframe is evaluated each logic tick using the IStepable interface.
A timeframe is a lightweight object for measuring a time interval.
Get the stepable interface shared pointer. The ITimeframe conforms to the IStepable interface.
Murl.SharedPointer.LogicIStepable GetStepable()
Reset the timeframe. Stop the timeframe, set the current time to zero and reset the WasRunning() state.
Reset()
Start the timeframe. The time starts with current time zero and is evaluated until the end time is reached.
Start()
Start the timeframe with a specified interval. The time starts with current time zero and is evaluated until the end time is reached.
Start(Number endTime)
endTime | The time interval in seconds. |
Set the current time. Modify the current time if the timeframe is running and the new time is within the interval [0 .. end time].
Boolean SetCurrentTime(Number time)
time | The current time in seconds. |
Finish the timeframe. Set the current time to the end time and the WasRunning() state to true if the timeframe is running.
Boolean Finish()
Check if the timeframe is running. A timeframe can be started by calling Start() and stopped by calling Finish() or Reset().
Boolean IsRunning()
Check if the timeframe was started from the beginning.
Boolean WasStarted()
Check if the timeframe has finished. If the timeframe is finished this state is true within the current logic tick only and will be cleared at the next logic tick.
(!) This state remains unchanged if the processor holding the timeframe's observer is set to inactive within the current logic tick. In such a case the Reset() method can be called to clear the state.
Boolean WasRunning()
Check if the timeframe is or was running. Returns (IsRunning() || WasRunning()) state.
Boolean IsOrWasRunning()
Check if the current time has passed a specified time within the most recent tick.
Boolean HasPassedTime(Number time)
time | The time to check in seconds. |
Set the time scale factor. The recent tick duration is multiplied by the time scale factor and added to the current time each logic tick. The default time scale factor is 1.
Boolean SetTimeScale(Number timeScale)
timeScale | The time scale factor. |
Get the time scale factor.
Number GetTimeScale()
Set the end time.
Boolean SetEndTime(Number endTime)
endTime | The end time in seconds. |
Get the end time.
Number GetEndTime()
Get the current time.
Number GetCurrentTime()
Get the remaining time. This method calculates GetEndTime() - GetCurrentTime().
Number GetRemainingTime()