Timer Class Reference

Timer as SDL middle man. More...

#include <Timer.h>

Inheritance diagram for Timer:

EventListener Object

List of all members.

Public Member Functions

 Timer ()
 The standard constructor.
Uint32 getTime ()
 Returns the current time index.
void reset ()
 Resets the timer.
void reset (const Uint32 &time)
 Resets the timer to a given value.
void processEvent (SDL_Event &event)
 Method to handle events from SDL.
virtual string toString () const
 Returns a textual representation.
virtual string className () const
 Returns the class name of the object.
virtual enum classId classId () const
 Returns the class id of the object.

Private Attributes

Uint32 lastSDLTicks
 The last time index passed by SDL.
Uint32 lastTime
 The last time that was given through getTime().
float timeFlow
 The current passage of time (1.0f is standard).
bool pause
 Is the timer on pause.
bool bullettime
 Is bullettime active?
GLint bullettimeFadeState
 Is bullettime fading (0 = no, 1 = fadeIn, 2 = fadeOut).
Uint32 bullettimeProgress
 Progression of the bullettime fade (in real time).
Uint32 bullettimeFadeTime
 The time to fade to/from bullettime (in real time).
GLfloat bullettimeSpeed
 The speed of bullettime.


Detailed Description

Timer as SDL middle man.

This object is an interactive clock that may be stopped, accelarated or slowed down.


Constructor & Destructor Documentation

Timer::Timer (  ) 

The standard constructor.

Simple initialization


Member Function Documentation

Uint32 Timer::getTime (  ) 

Returns the current time index.

Returns:
The new timeindex in ms based on the passed system time and the custom timeflow

void Timer::reset (  ) 

Resets the timer.

Restarts the timer and sets it to 0

void Timer::reset ( const Uint32 &  time  ) 

Resets the timer to a given value.

Restarts the timer at the given time

Parameters:
time The time index in ms from which to count up again

void Timer::processEvent ( SDL_Event &  event  )  [virtual]

Method to handle events from SDL.

Parameters:
event The SDL Event to be evaluated

Implements EventListener.

string Timer::toString (  )  const [virtual]

Returns a textual representation.

Returns:
a string descriping the run-time object

Implements EventListener.

string Timer::className (  )  const [virtual]

Returns the class name of the object.

Returns:
a string with the name of the object's class

Implements EventListener.

enum classId Timer::classId (  )  const [virtual]

Returns the class id of the object.

Returns:
an id of the object's class

Implements EventListener.


Member Data Documentation

Uint32 Timer::lastSDLTicks [private]

The last time index passed by SDL.

Uint32 Timer::lastTime [private]

The last time that was given through getTime().

float Timer::timeFlow [private]

The current passage of time (1.0f is standard).

bool Timer::pause [private]

Is the timer on pause.

bool Timer::bullettime [private]

Is bullettime active?

GLint Timer::bullettimeFadeState [private]

Is bullettime fading (0 = no, 1 = fadeIn, 2 = fadeOut).

Uint32 Timer::bullettimeProgress [private]

Progression of the bullettime fade (in real time).

Uint32 Timer::bullettimeFadeTime [private]

The time to fade to/from bullettime (in real time).

GLfloat Timer::bullettimeSpeed [private]

The speed of bullettime.


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

Generated on Mon Jul 7 13:30:35 2008 for Firefly by  doxygen 1.5.6