torque Torque Game Engine Documentation
TGE Version 1.5.2

SimEvent Class Reference

#include <simBase.h>

Inheritance diagram for SimEvent:

Inheritance graph
[legend]

Detailed Description

Represents a queued event in the sim.

Sim provides an event queue for your convenience, which can be used to schedule events. A few things which use this event queue:

  • The scene lighting system. In order to keep the game responsive while scene lighting occurs, the lighting process is divided into little chunks. In implementation terms, there is a subclass of SimEvent called SceneLightingProcessEvent. The process method of this subclass calls into the lighting code, telling it to perform the next chunk of lighting calculations.
  • The schedule() console function uses a subclass of SimEvent called SimConsoleEvent to keep track of scheduled events.


Public Member Functions

 SimEvent ()
virtual ~SimEvent ()
 Destructor.
virtual void process (SimObject *object)=0
 Function called when event occurs.

Data Fields

SimEventnextEvent
 Linked list details - pointer to next item in the list.
SimTime startTime
 When the event was posted.
SimTime time
 When the event is scheduled to occur.
U32 sequenceCount
 Unique ID.
SimObjectdestObject
 Object on which this event will be applied.


Constructor & Destructor Documentation

SimEvent::SimEvent (  )  [inline]

virtual SimEvent::~SimEvent (  )  [inline, virtual]

Destructor.

A dummy virtual destructor is required so that subclasses can be deleted properly


Member Function Documentation

virtual void SimEvent::process ( SimObject object  )  [pure virtual]

Function called when event occurs.

This is where the meat of your event's implementation goes.

See any of the subclasses for ideas of what goes in here.

The event is deleted immediately after processing. If the object referenced in destObject is deleted, then the event is not called. The even will be executed unconditionally if the object referenced is NULL.

Parameters:
object Object stored in destObject.

Implemented in SimConsoleEvent, SimConsoleThreadExecEvent, QuitEvent, and sgSceneLightingProcessEvent.


Field Documentation

Linked list details - pointer to next item in the list.

When the event was posted.

When the event is scheduled to occur.

Unique ID.

These are assigned sequentially based on order of addition to the list.

Object on which this event will be applied.




All Rights Reserved GarageGames.com, Inc. 1999-2005
Auto-magically Generated with Doxygen