Public Member Functions | |
ScriptManager () | |
Constructor. | |
~ScriptManager () | |
Deconstructor. | |
void | init () |
Initialises the ScriptManager. | |
void | clear () |
Clears the ScriptManager. | |
void | grab () |
Increases the reference counter. | |
void | drop () |
Decreases the reference counter. | |
asIScriptEngine * | getEngine () const |
Returns a direct pointer to the AngelScript engine. | |
bool | addScript (Script *script) |
Adds the given Script to the ScriptManager. | |
bool | addScriptSection (const std::string &name, const std::string §ion) |
Adds a script section to the ScriptManager. These script sections are added to all scripts. | |
Script * | createScript (const std::string &name, bool grab=true) |
Creates (and adds) an script with the given name. | |
Script * | createScriptFromFile (const std::string &fileName, bool grab=true) |
Creates an script with the given name, loaded from the given file. | |
Script * | createScriptFromFile (IReadFile *file, bool grab=true) |
Creates an script with the given name, loaded from the given file. | |
Script * | getScript (const u32 id) |
Gets the Script with the given ID. | |
Script * | getScript (const std::string &name) |
Gets the Script with the given name. | |
void | removeScripts () |
Removes all scripts from the ScriptManager. | |
void | removeScriptSections () |
Removes all script sections from the ScriptManager. | |
bool | removeScript (Script *script) |
Removes the given Script. | |
bool | removeScript (const u32 id) |
Removes the given Script with the given ID. | |
bool | removeScript (const std::string &name) |
Removes the given Script with the given name. | |
bool | removeScriptSection (const std::string &name) |
Removes the script section with the given name. | |
Friends | |
class | Script |
Definition at line 34 of file ScriptManager.h.
ScriptManager::ScriptManager | ( | ) |
ScriptManager::~ScriptManager | ( | ) |
bool ScriptManager::addScript | ( | Script * | script | ) |
Adds the given Script to the ScriptManager.
script | Pointer to the Script to add. |
Definition at line 143 of file ScriptManager.cpp.
bool ScriptManager::addScriptSection | ( | const std::string & | name, | |
const std::string & | section | |||
) |
Adds a script section to the ScriptManager. These script sections are added to all scripts.
name | Name of the script section. | |
section | Contents of the section. |
Definition at line 161 of file ScriptManager.cpp.
void ScriptManager::clear | ( | ) |
Script * ScriptManager::createScript | ( | const std::string & | name, | |
bool | grab = true | |||
) |
Creates (and adds) an script with the given name.
name | Name of the script. | |
grab | Should the ScriptManager add the loaded script to the internal list? |
Definition at line 189 of file ScriptManager.cpp.
Script * ScriptManager::createScriptFromFile | ( | IReadFile * | file, | |
bool | grab = true | |||
) |
Creates an script with the given name, loaded from the given file.
file | Pointer to the IReadFile that will be used. | |
grab | Should the ScriptManager add the loaded script to the internal list? |
Definition at line 236 of file ScriptManager.cpp.
Script * ScriptManager::createScriptFromFile | ( | const std::string & | fileName, | |
bool | grab = true | |||
) |
Creates an script with the given name, loaded from the given file.
fileName | Filename of the file to load. | |
grab | Should the ScriptManager add the loaded script to the internal list? |
Definition at line 208 of file ScriptManager.cpp.
void ScriptManager::drop | ( | ) | [virtual] |
Decreases the reference counter.
Reimplemented from ReferenceCounted.
Definition at line 131 of file ScriptManager.cpp.
asIScriptEngine * ScriptManager::getEngine | ( | ) | const |
Returns a direct pointer to the AngelScript engine.
Definition at line 137 of file ScriptManager.cpp.
Script * ScriptManager::getScript | ( | const std::string & | name | ) |
Gets the Script with the given name.
Definition at line 268 of file ScriptManager.cpp.
Script * ScriptManager::getScript | ( | const u32 | id | ) |
Gets the Script with the given ID.
Definition at line 256 of file ScriptManager.cpp.
void ScriptManager::grab | ( | ) | [virtual] |
Increases the reference counter.
Reimplemented from ReferenceCounted.
Definition at line 125 of file ScriptManager.cpp.
void ScriptManager::init | ( | ) |
bool ScriptManager::removeScript | ( | const std::string & | name | ) |
Removes the given Script with the given name.
name | Name of the Script to remove. |
Definition at line 343 of file ScriptManager.cpp.
bool ScriptManager::removeScript | ( | const u32 | id | ) |
Removes the given Script with the given ID.
id | ID of the Script to remove. |
Definition at line 321 of file ScriptManager.cpp.
bool ScriptManager::removeScript | ( | Script * | script | ) |
Removes the given Script.
script | Pointer to the Script to remove. |
Definition at line 295 of file ScriptManager.cpp.
void ScriptManager::removeScripts | ( | ) |
bool ScriptManager::removeScriptSection | ( | const std::string & | name | ) |
Removes the script section with the given name.
name | Name of the script section to remove. |
Definition at line 365 of file ScriptManager.cpp.
void ScriptManager::removeScriptSections | ( | ) |
Removes all script sections from the ScriptManager.
Definition at line 289 of file ScriptManager.cpp.
friend class Script [friend] |
Definition at line 36 of file ScriptManager.h.