TorqueScript Reference

- Main Page
- Related Pages
- Modules
- Classes

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

Public Member Functions | List of all members
EventManager Class Reference

Inherits SimObject.

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

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

  event | The event whose subscribers are to be printed. If this parameter isn't specified, all events will be dumped.

Boolean isRegisteredEvent | ( | String | event | ) |

Check if an event is registered or not.

Parameters

  event | The event to check.

Returns
  Whether or not the event exists.

Boolean postEvent | ( | String | event,
|  | String | data
| ) |  |

Trigger an event.

Parameters

  event | The event to trigger.
  data | The data associated with the event.

Returns
  Whether or not the event was dispatched successfully.

Boolean registerEvent | ( | String | event | ) |

Register an event with the event manager.

Parameters

  event | The 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

  listener | The listener to remove.
  event | The event to be removed from.

Boolean subscribe | ( | SimObject | listener,
|  | String | event,
|  | String | callback
| ) |  |

Subscribe a listener to an event.

Parameters

  listener | The listener to subscribe.
  event | The event to subscribe to.
  callback | Optional 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

  event | The event to remove.