TorqueScript Reference

- Main Page
- Related Pages
- Modules
- Classes

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

Public Member Functions | List of all members
ModuleManager Class Reference

Inherits SimObject.

## Public Member Functions
void | addListener (listenerObject)
Boolean | canMergeModules (mergeSourcePath)
String | copyModule (sourceModuleDefinition, targetModuleId, targetPath, useVersionPathing?)
String | findModule (moduleId, versionId)
String | findModules (loadedOnly?)
String | findModuleTypes (moduleType, loadedOnly?)
Boolean | isModuleMergeAvailable ()
Boolean | loadExplicit (moduleId, [versionId])
Boolean | loadGroup (moduleGroup)
Boolean | mergeModules (mergeTargetPath, removeMergeDefinition, registerNewModules)
void | removeListener (listenerObject)
Boolean | scanModules (moduleRootPath, [rootOnly=false])
Boolean | setModuleExtension (moduleExtension)
Boolean | synchronizeDependencies (rootModuleDefinition, targetDependencyPath)
Boolean | unloadExplicit (moduleId)
Boolean | unloadGroup (moduleGroup)
Boolean | unregisterModule (moduleId, versionId)
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 addListener | ( | listenerObject |  | ) |

Registers the specified object as a listener for module notifications.

Parameters

  listenerObject | The object to start receiving module notifications.

Returns
  No return value.

Boolean canMergeModules | ( | mergeSourcePath |  | ) |

Checks whether a module merge using the modules in the source path can current happen or not.

Parameters

  mergeSourcePath | The path where modules to be merged are located.

Returns
  Whether a module merge using the modules in the source path can current happen or not.

String copyModule | ( | sourceModuleDefinition | ,
|  | targetModuleId | ,
|  | targetPath | ,
|  | useVersionPathing? |
| ) |  |

Copy the module to a new location with a new module Id.

Parameters

  sourceModuleDefinition | The module definition to copy.
  targetModuleId | The module Id to rename the copied module to including all references to the source module Id. It is valid to specifiy the source module Id to produce an identical copy.
  targetPath | The target path to copy the module to. Addition folders will be created depending on whether 'useVersionPathing' is used or not.
  useVersionPathing | Whether to add a '/targetModuleId/versionId' folder to the target path or not. This allows copying multiple versions of the same module Id.

Returns
  The new module definition file if copy was successful or NULL if not.

String findModule | ( | moduleId | ,
|  | versionId |
| ) |  |

Find the specific module Id optionally at the specified version Id.

Parameters

  moduleId | The module Id to find.
  versionId | The version Id to find.

Returns
  The module definition object or NULL if not found.

String findModules | ( | loadedOnly? |  | ) |

Find all the modules registered with the specified loaded state.

Parameters

  loadedOnly | Whether to return only modules that are loaded or not.

Returns
  A list of space-separated module definition object Ids.

String findModuleTypes | ( | moduleType | ,
|  | loadedOnly? |
| ) |  |

Find the modules registered with the specified module type.

Parameters

  moduleType | The module type to search for.
  loadedOnly | Whether to return only modules that are loaded or not.

Returns
  A list of space-separated module definition object Ids.

Boolean isModuleMergeAvailable | ( |  | ) |

Checks whether a module merge definition file is available or not.

Returns
  Whether a module merge definition file is available or not.

Boolean loadExplicit | ( | moduleId |  | ) |

Load the specified module explicitly.

Parameters

  moduleId | The module Id to load.
  versionId | The version Id to load. Optional: Will load the latest version.

Returns
  Whether the module Id was loaded or not.

Boolean loadGroup | ( | moduleGroup |  | ) |

Load the specified module group.

Parameters

  moduleGroup | The module group to load.

Returns
  Whether the module group was loaded or not.

Boolean mergeModules | ( | mergeTargetPath | ,
|  | removeMergeDefinition | ,
|  | registerNewModules |
| ) |  |

Performs a module merge into the selected target path.

Parameters

  mergeTargetPath | The path where modules will be merged into.
  removeMergeDefinition | Whether to remove any merge definition found or not if merge is successful.
  registerNewModules | Whether new (not replaced or updated) modules should be registered or not.

Returns
  Whether the module merge was successful or not. Failure here could result in a corrupt module state. Reinstall is recommended or at least advised to the user is recommended.

void removeListener | ( | listenerObject |  | ) |

Unregisters the specified object as a listener for module notifications.

Parameters

  listenerObject | The object to stop receiving module notifications.

Returns
  No return value.

Boolean scanModules | ( | moduleRootPath |  | ) |

Scans for modules which are sub-directories of the specified path.

Parameters

  moduleRootPath | The root directory to scan for sub-directories containing modules.
  rootOnly | [Optional] - Specifies whether to only scan the root path or not when searching for modules.

Returns
  Whether the scan was successful or not. A successful scan can still find zero modules.

Boolean setModuleExtension | ( | moduleExtension |  | ) |

Set the module extension used to scan for modules. The default is 'module'.

Parameters

  moduleExtension | The module extension used to scan for modules. Do not use a period character.

Returns
  Whether setting the module extension was successful or not.

Boolean synchronizeDependencies | ( | rootModuleDefinition | ,
|  | targetDependencyPath |
| ) |  |

Synchronize the module dependencies of a module definition to a target dependency folder.

Parameters

  rootModuleDefinition | The module definition used to determine dependencies.
  targetDependencyPath | The target dependency folder to copy dependencies to.

Returns
  Whether the module dependencies were synchronized correctly or not.

Boolean unloadExplicit | ( | moduleId |  | ) |

Unload the specified module explicitly.

Parameters

  moduleId | The module Id to unload.

Returns
  Whether the module Id was unloaded or not.

Boolean unloadGroup | ( | moduleGroup |  | ) |

Unload the specified module group.

Parameters

  moduleGroup | The module group to unload.

Returns
  Whether the module group was unloaded or not.

Boolean unregisterModule | ( | moduleId | ,
|  | versionId |
| ) |  |

Unregister the specified module.

Parameters

  moduleId | The module Id to unregister.
  versionId | The version Id to unregister.

Returns
  Whether the module was unregister or not.