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

#include <timemanager.h>

Inheritance diagram for FIFE::TimeManager:
Inheritance graph
Collaboration diagram for FIFE::TimeManager:
Collaboration graph

Public Member Functions

 TimeManager ()
 
virtual ~TimeManager ()
 
void update ()
 
void registerEvent (TimeEvent *event)
 
void unregisterEvent (TimeEvent *event)
 
uint32_t getTime () const
 
uint32_t getTimeDelta () const
 
double getAverageFrameTime () const
 
void printStatistics () const
 

Detailed Description

Time Manager

This class is in charge of storing the current time, average frame time, as well as controlling periodic events. Users of this class will have to manually register and unregister events.

See Also
TimeEvent

Definition at line 50 of file timemanager.h.

Constructor & Destructor Documentation

FIFE::TimeManager::TimeManager ( )

Default constructor.

Definition at line 42 of file timemanager.cpp.

FIFE::TimeManager::~TimeManager ( )
virtual

Destructor.

Definition at line 48 of file timemanager.cpp.

Member Function Documentation

double FIFE::TimeManager::getAverageFrameTime ( ) const

Gets average frame time

Returns
Average frame time in milliseconds.

Definition at line 108 of file timemanager.cpp.

uint32_t FIFE::TimeManager::getTime ( ) const

Get the time.

Returns
The time in milliseconds.

Definition at line 100 of file timemanager.cpp.

Referenced by FIFE::Cursor::draw(), FIFE::Cursor::set(), and FIFE::Cursor::setDrag().

Here is the caller graph for this function:

uint32_t FIFE::TimeManager::getTimeDelta ( ) const

Get the time since the last frame.

Returns
Time since last frame in milliseconds.

Definition at line 104 of file timemanager.cpp.

void FIFE::TimeManager::printStatistics ( ) const

Prints Timer statistics

Definition at line 112 of file timemanager.cpp.

void FIFE::TimeManager::registerEvent ( TimeEvent event)

Adds a TimeEvent.

The event will be updated regularly, depending on its settings.

Parameters
eventThe TimeEvent object to be added.

Definition at line 84 of file timemanager.cpp.

void FIFE::TimeManager::unregisterEvent ( TimeEvent event)

Removes a TimeEvent.

Removes an event from the list. It will not be deleted.

Parameters
eventThe TimeEvent object to be removed.

Definition at line 89 of file timemanager.cpp.

void FIFE::TimeManager::update ( )

Called once a frame and updates the timer objects and events.

Definition at line 51 of file timemanager.cpp.

Referenced by FIFE::Engine::pump().

Here is the caller graph for this function:


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