Torque2D Reference

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Public Attributes | List of all members
SimEvent Class Referenceabstract

`#include <simEvent.h>`

Inheritance diagram for SimEvent:

## Public Member Functions
| SimEvent ()
virtual | ~SimEvent ()
virtual void | process (SimObject *object)=0

## Public Attributes
SimEvent * | nextEvent
| Linked list details - pointer to next item in the list. More...
SimTime | startTime
| When the event was posted. More...
SimTime | time
| When the event is scheduled to occur. More...
U32 | sequenceCount
SimObject * | destObject
| Object on which this event will be applied. More...

## 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.

## Constructor & Destructor Documentation

SimEvent | ( |  | ) |
| inline

virtual ~SimEvent | ( |  | ) |
| inline virtual

Destructor

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

## Member Function Documentation

virtual void 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 ConPrinfThreadedEvent, NetDelayEvent, HeartbeatEvent, ProcessPacketEvent, ProcessPingEvent, ProcessMasterQueryEvent, SimConsoleEvent, SimConsoleThreadExecEvent, BehaviorComponentRaiseEvent, SimObjectTimerEvent, and SceneObjectRotateToEvent.

## Member Data Documentation

SimObject* destObject

Object on which this event will be applied.

SimEvent* nextEvent

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

U32 sequenceCount

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

SimTime startTime

When the event was posted.

SimTime time

When the event is scheduled to occur.

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

- sim/simEvent.h