FIFE  2008.0
 All Classes Namespaces Functions Variables Enumerations Enumerator Pages
FIFE::TimeProvider Class Reference

#include <timeprovider.h>

Collaboration diagram for FIFE::TimeProvider:
Collaboration graph

List of all members.

Public Member Functions

 TimeProvider (TimeProvider *master)
void setMultiplier (float multiplier)
float getMultiplier () const
float getTotalMultiplier () const
unsigned int getGameTime () const

Detailed Description

Timeprovider is an utility providing time management functionality You can have hierarchy of time providers, whose multiplier can be changed independently. Changing providers upper in the hierarchy, changes also all subproviders with the same ratio

Definition at line 41 of file timeprovider.h.


Constructor & Destructor Documentation

FIFE::TimeProvider::TimeProvider ( TimeProvider master)
explicit

Constructor In case there there is no provider master, you can use NULL

Definition at line 36 of file timeprovider.cpp.

References getGameTime().


Member Function Documentation

unsigned int FIFE::TimeProvider::getGameTime ( ) const

Returns current game ticks, already scaled.

Definition at line 65 of file timeprovider.cpp.

Referenced by FIFE::Instance::getRuntime(), and TimeProvider().

Here is the caller graph for this function:

float FIFE::TimeProvider::getMultiplier ( ) const
See also:
setMultiplier. Returns mutliplier for this single provider

Definition at line 53 of file timeprovider.cpp.

Referenced by FIFE::Map::getTimeMultiplier(), and FIFE::Model::getTimeMultiplier().

Here is the caller graph for this function:

float FIFE::TimeProvider::getTotalMultiplier ( ) const
See also:
setMultiplier. Returns mutliplier for whole chain of timeproviders E.g. if master has multiplier 2.0 and this has 0.5, end result = 1.0

Definition at line 57 of file timeprovider.cpp.

References getTotalMultiplier().

Referenced by getTotalMultiplier(), and FIFE::Instance::getTotalTimeMultiplier().

Here is the caller graph for this function:

void FIFE::TimeProvider::setMultiplier ( float  multiplier)

With multiplier, you can adjust the time speed. 0.5 means time runs half as slow, while 2.0 means it runs twice as fast

Definition at line 44 of file timeprovider.cpp.

Referenced by FIFE::Map::setTimeMultiplier(), and FIFE::Model::setTimeMultiplier().

Here is the caller graph for this function:


The documentation for this class was generated from the following files: