FIFE::TimeEvent Class Reference

#include <timeevent.h>

Inheritance diagram for FIFE::TimeEvent:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 TimeEvent (int period=-1)
virtual ~TimeEvent ()
virtual void updateEvent (unsigned long time)=0
void managerUpdateEvent (unsigned long time)
void setPeriod (int period)
int getPeriod ()
unsigned long getLastUpdateTime ()
void setLastUpdateTime (unsigned long)

Detailed Description

Interface for events to be registered with TimeManager.

To register a class with TimeManager firstly derive a class from this and override the updateEvent() function. updateEvent() will be called periodically depending on the value of getPeriod() which can be set using the constructor or setPeriod(). A value of -1 will never be updated, 0 will updated every frame and a value over 0 defines the number of milliseconds between updates.

See also:
TimeManager

Definition at line 47 of file timeevent.h.


Constructor & Destructor Documentation

FIFE::TimeEvent::TimeEvent ( int  period = -1  ) 

Default constructor.

Parameters:
period The period of the event. See class description.

Definition at line 35 of file timeevent.cpp.

FIFE::TimeEvent::~TimeEvent (  )  [virtual]

Destructor.

Definition at line 40 of file timeevent.cpp.


Member Function Documentation

unsigned long FIFE::TimeEvent::getLastUpdateTime (  ) 

Get the last time the event was updated.

Returns:
Time of last update.

Definition at line 62 of file timeevent.cpp.

int FIFE::TimeEvent::getPeriod (  ) 

Get the period of the event.

Returns:
The period of the event. See class description.

Definition at line 58 of file timeevent.cpp.

void FIFE::TimeEvent::managerUpdateEvent ( unsigned long  time  ) 

Called by TimeManager to update the event.

Parameters:
time Current time. Used To check if its time to update.

Definition at line 44 of file timeevent.cpp.

References updateEvent().

void FIFE::TimeEvent::setLastUpdateTime ( unsigned long  ms  ) 

Set the last time the event was updated.

Parameters:
Time of last update.

Definition at line 66 of file timeevent.cpp.

void FIFE::TimeEvent::setPeriod ( int  period  ) 

Set the period of the event.

Parameters:
period The period of the event. See class description.

Definition at line 54 of file timeevent.cpp.

Referenced by FIFE::SoundEmitter::play(), FIFE::SoundEmitter::reset(), FIFE::SoundEmitter::setCursor(), and FIFE::SoundEmitter::stop().

Here is the caller graph for this function:

virtual void FIFE::TimeEvent::updateEvent ( unsigned long  time  )  [pure virtual]

Update function to be overridden by client.

Parameters:
time_delta Time.

Referenced by managerUpdateEvent().

Here is the caller graph for this function:


The documentation for this class was generated from the following files:
Generated by  doxygen 1.6.2-20100208