45 if (multiplier < 0.0) {
46 throw NotSupported(
"Negative time multiplier are not supported");
74 return static_cast<uint32_t>(
static_cast<float>(ticks) * multiplier);
Timeprovider is an utility providing time management functionality You can have hierarchy of time pro...
void setMultiplier(float multiplier)
With multiplier, you can adjust the time speed.
uint32_t getTime() const
Get the time.
TimeProvider(TimeProvider *master)
Constructor In case there there is no provider master, you can use NULL.
static TimeManager * instance()
float getTotalMultiplier() const
uint32_t getGameTime() const
Returns current game ticks, already scaled.
float getMultiplier() const
double getPreciseGameTime() const
Returns current game ticks, already scaled, more precise.
uint32_t scaleTime(float multiplier, uint32_t ticks)
Utility function to calculate time scaling.