![]() |
Murl Engine API
Version 2018.3
|
The ITimeframe interface. More...
#include <murl_logic_i_timeframe.h>
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.
Public Member Functions | |
virtual IStepablePtr | GetStepable ()=0 |
Get the stepable interface shared pointer. More... | |
virtual void | Reset ()=0 |
Reset the timeframe. More... | |
virtual void | Start ()=0 |
Start the timeframe. More... | |
virtual void | Start (Real endTime)=0 |
Start the timeframe with a specified interval. More... | |
virtual Bool | SetCurrentTime (Real time)=0 |
Set the current time. More... | |
virtual Bool | Finish ()=0 |
Finish the timeframe. More... | |
virtual Bool | IsRunning () const =0 |
Check if the timeframe is running. More... | |
virtual Bool | WasStarted () const =0 |
Check if the timeframe was started from the beginning. More... | |
virtual Bool | WasRunning () const =0 |
Check if the timeframe has finished. More... | |
virtual Bool | IsOrWasRunning () const =0 |
Check if the timeframe is or was running. More... | |
virtual Bool | HasPassedTime (Real time) const =0 |
Check if the current time has passed a specified time within the most recent tick. More... | |
virtual Bool | SetTimeScale (Real timeScale)=0 |
Set the time scale factor. More... | |
virtual Real | GetTimeScale () const =0 |
Get the time scale factor. More... | |
virtual Bool | SetEndTime (Real endTime)=0 |
Set the end time. More... | |
virtual Real | GetEndTime () const =0 |
Get the end time. More... | |
virtual Double | GetCurrentTime () const =0 |
Get the current time. More... | |
virtual Double | GetRemainingTime () const =0 |
Get the remaining time. More... | |
|
pure virtual |
Get the stepable interface shared pointer.
The ITimeframe conforms to the IStepable interface.
Implemented in Murl::Logic::Timeframe.
|
pure virtual |
Reset the timeframe.
Stop the timeframe, set the current time to zero and reset the WasRunning() state.
Implemented in Murl::Logic::Timeframe.
|
pure virtual |
Start the timeframe.
The time starts with current time zero and is evaluated until the end time is reached.
Implemented in Murl::Logic::Timeframe.
|
pure virtual |
Start the timeframe with a specified interval.
The time starts with current time zero and is evaluated until the end time is reached.
endTime | The time interval in seconds. |
Implemented in Murl::Logic::Timeframe.
Set the current time.
Modify the current time if the timeframe is running and the new time is within the interval [0 .. end time].
time | The current time in seconds. |
Implemented in Murl::Logic::Timeframe.
|
pure virtual |
Finish the timeframe.
Set the current time to the end time and the WasRunning() state to true if the timeframe is running.
Implemented in Murl::Logic::Timeframe.
|
pure virtual |
Check if the timeframe is running.
A timeframe can be started by calling Start() and stopped by calling Finish() or Reset().
Implemented in Murl::Logic::Timeframe.
|
pure virtual |
Check if the timeframe was started from the beginning.
Implemented in Murl::Logic::Timeframe.
|
pure virtual |
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.
Implemented in Murl::Logic::Timeframe.
|
pure virtual |
Check if the timeframe is or was running.
Returns (IsRunning() || WasRunning()) state.
Implemented in Murl::Logic::Timeframe.
Check if the current time has passed a specified time within the most recent tick.
time | The time to check in seconds. |
Implemented in Murl::Logic::Timeframe.
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.
timeScale | The time scale factor. |
Implemented in Murl::Logic::Timeframe.
|
pure virtual |
Set the end time.
endTime | The end time in seconds. |
Implemented in Murl::Logic::Timeframe.
|
pure virtual |
|
pure virtual |
|
pure virtual |
Get the remaining time.
This method calculates GetEndTime() - GetCurrentTime().
Implemented in Murl::Logic::Timeframe.