TorqueScript Reference
Public Member Functions | List of all members
EventManager Class Reference

Inherits SimObject.

Public Member Functions

void dumpEvents ()
 
void dumpSubscribers (String event)
 
bool isRegisteredEvent (String event)
 
bool postEvent (String event, String data)
 
bool registerEvent (String event)
 
void remove (SimObject listener, String event)
 
bool subscribe (SimObject listener, String event, String callback)
 
void unregisterEvent (String event)
 
- Public Member Functions inherited from SimObject
string call (functionName,[args]*)
 
int clone ([bool copyDynamicFields?=false]?)
 
void delete ()
 
void dump ()
 
void dumpClassHierarchy ()
 
const char * getClassName ()
 
string getClassNamespace ()
 
string getDynamicField (index)
 
int getDynamicFieldCount ()
 
string getField (int index)
 
int getFieldCount ()
 
const char * getFieldType (fieldName)
 
const char * getFieldValue (fieldName)
 
int getGroup ()
 
int getId ()
 
string getInternalName ()
 
const char * getName ()
 
string getProgenitorFile ()
 
string getSuperClassNamespace ()
 
int getType ()
 
bool isChildOfGroup ()
 
bool isMemberOfClass (string classname)
 
bool isMethod (const char *methodName)
 
bool isMethod (string method name)
 
bool isTimerActive ()
 
bool save (fileName,[selectedOnly]?)
 
int schedule (time, command,[arg]*)
 
void setClassNamespace ()
 
bool setFieldValue (fieldName, value)
 
void setInternalName (string InternalName)
 
void setName (newName)
 
void setProgenitorFile (file)
 
void setSuperClassNamespace ()
 
bool startTimer (callbackFunction, float timePeriod,[repeat]?)
 
void stopTimer ()
 

Additional Inherited Members

- Static Public Member Functions inherited from SimObject
static S32 QSORT_CALLBACK compareFields (const void *a, const void *b)
 

Member Function Documentation

void dumpEvents ( )

Print all registered events to the console.

void dumpSubscribers ( String  event)

Print all subscribers to an event to the console.

Parameters
eventThe event whose subscribers are to be printed. If this parameter isn't specified, all events will be dumped.
bool isRegisteredEvent ( String  event)

Check if an event is registered or not.

Parameters
eventThe event to check.
Returns
Whether or not the event exists.
bool postEvent ( String  event,
String  data 
)

Trigger an event.

Parameters
eventThe event to trigger.
dataThe data associated with the event.
Returns
Whether or not the event was dispatched successfully.
bool registerEvent ( String  event)

Register an event with the event manager.

Parameters
eventThe event to register.
Returns
Whether or not the event was registered successfully.
void remove ( SimObject  listener,
String  event 
)

Remove a listener from an event.

Parameters
listenerThe listener to remove.
eventThe event to be removed from.
bool subscribe ( SimObject  listener,
String  event,
String  callback 
)

Subscribe a listener to an event.

Parameters
listenerThe listener to subscribe.
eventThe event to subscribe to.
callbackOptional method name to receive the event notification. If this is not specified, [event]\ will be used.
Returns
Whether or not the subscription was successful.
void unregisterEvent ( String  event)

Remove an event from the EventManager.

Parameters
eventThe event to remove.