time_event_handler Class Reference

This class keeps track of time events, i.e. More...

#include <time_event_handler.h>

Inheritance diagram for time_event_handler:

Inheritance graph
[legend]
Collaboration diagram for time_event_handler:

Collaboration graph
[legend]

List of all members.

Public Member Functions

void register_event (event *evnt)
 Register a time event with the event handler.
void remove_event (event *evnt)
 Removes the given event from the event handler.
void raise_event (const event *evnt)
 Raise one or more events in case the given time matches their "alarm" time.


Detailed Description

This class keeps track of time events, i.e.

events that are raised at a certain point in (game) time. All registered events are sorted by the time they need to be raised, so that only one comparison decides upon whether an event is to be raised.

Definition at line 36 of file time_event_handler.h.


Member Function Documentation

void time_event_handler::register_event ( event evnt  )  [virtual]

Register a time event with the event handler.

It is inserted into the vector of registered events depending on its "alarm" time. The event needs to be removed before it can be safely deleted.

Parameters:
evnt Pointer to the event to be registered.

Implements event_handler_base.

Definition at line 69 of file time_event_handler.cc.

void time_event_handler::remove_event ( event evnt  )  [virtual]

Removes the given event from the event handler.

Once it is no longer needed, it can be freed.

Parameters:
evnt Pointer to the event to be removed.

Implements event_handler_base.

Definition at line 57 of file time_event_handler.cc.

void time_event_handler::raise_event ( const event evnt  )  [virtual]

Raise one or more events in case the given time matches their "alarm" time.

When they need to be repeated, they are re-inserted into the event-vector.

Parameters:
evnt An event structure with the current game time in minutes.

Implements event_handler_base.

Definition at line 30 of file time_event_handler.cc.


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

Generated on Thu Sep 25 18:59:30 2008 for Adonthell by  doxygen 1.5.6