5#include <Foundation/Basics.h>
6#include <Foundation/Communication/Event.h>
7#include <Foundation/IO/Stream.h>
8#include <Foundation/Reflection/Reflection.h>
9#include <Foundation/Time/Time.h>
28 void Reset(
bool bEverything);
46 void SetPaused(
bool bPaused);
49 bool GetPaused()
const;
60 plTime GetFixedTimeStep()
const;
68 void SetAccumulatedTime(
plTime t);
75 plTime GetAccumulatedTime()
const;
81 plTime GetTimeDiff()
const;
84 void SetSpeed(
double fFactor);
87 double GetSpeed()
const;
96 void SetMinimumTimeStep(
plTime min);
105 void SetMaximumTimeStep(
plTime max);
109 plTime GetMinimumTimeStep()
const;
113 plTime GetMaximumTimeStep()
const;
136 plTime m_SmoothedTimeStep;
149 PL_MAKE_SUBSYSTEM_STARTUP_FRIEND(Foundation, Clock);
151 static Event s_TimeEvents;
152 static plClock* s_pGlobalClock;
199PL_DECLARE_REFLECTABLE_TYPE(PL_FOUNDATION_DLL,
plClock);
201#include <Foundation/Time/Implementation/Clock_inl.h>
A clock that can be speed up, slowed down, paused, etc. Useful for updating game logic,...
Definition Clock.h:15
static void AddEventHandler(Event::Handler handler)
Allows to register a function as an event receiver. All receivers will be notified in the order that ...
Definition Clock.h:142
static void RemoveEventHandler(Event::Handler handler)
Unregisters a previously registered receiver. It is an error to unregister a receiver that was not re...
Definition Clock.h:145
static plClock * GetGlobalClock()
Returns the global clock.
Definition Clock.h:18
Interface for binary in (read) streams.
Definition Stream.h:22
Interface for binary out (write) streams.
Definition Stream.h:107
plStringView represent a read-only sub-string of a larger string, as it can store a dedicated string ...
Definition StringView.h:34
Base class for all time step smoothing algorithms.
Definition Clock.h:175
virtual void Reset(const plClock *pClock)=0
Called when plClock::Reset(), plClock::Load() or plClock::SetPaused(true) was called.
virtual plTime GetSmoothedTimeStep(plTime rawTimeStep, const plClock *pClock)=0
The function to override to implement time step smoothing.
The data that is sent through the event interface.
Definition Clock.h:132
The time class encapsulates a double value storing the time in seconds.
Definition Time.h:12