ScriptManager Class Reference

The Script Manager is the central interface point to all script related functions of this program. More...

List of all members.

Public Member Functions

 ScriptManager ()
 Constructor.
 ~ScriptManager ()
 Deconstructor.
void init ()
 Initialises the ScriptManager.
void clear ()
 Clears the ScriptManager.
void refAdd ()
 Increases the reference counter.
void refRelease ()
 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 &section)
 Adds a script section to the ScriptManager. These script sections are added to all scripts.
ScriptcreateScript (const std::string &name)
 Creates (and adds) an script with the given name.
ScriptcreateScriptFromFile (const std::string &fileName)
 Creates an script with the given name, loaded from the given file.
ScriptgetScript (const u32 id)
 Gets the Script with the given ID.
ScriptgetScript (const std::string &name)
 Gets the Script with the given name.
void removeAllScripts ()
 Removes all scripts from the ScriptManager.
void removeAllScriptSections ()
 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


Detailed Description

The Script Manager is the central interface point to all script related functions of this program.

Definition at line 32 of file ScriptManager.h.


Constructor & Destructor Documentation

ScriptManager::ScriptManager (  ) 

Constructor.

Definition at line 25 of file ScriptManager.cpp.

ScriptManager::~ScriptManager (  ) 

Deconstructor.

Definition at line 30 of file ScriptManager.cpp.


Member Function Documentation

bool ScriptManager::addScript ( Script script  ) 

Adds the given Script to the ScriptManager.

Parameters:
script Pointer to the Script to add.
Returns:
True if addition was successful, false if addition was a failure.

Definition at line 103 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.

Parameters:
name Name of the script section.
section Contents of the section.

Definition at line 120 of file ScriptManager.cpp.

void ScriptManager::clear (  ) 

Clears the ScriptManager.

Definition at line 72 of file ScriptManager.cpp.

Script * ScriptManager::createScript ( const std::string &  name  ) 

Creates (and adds) an script with the given name.

Parameters:
name Name of the script.
Returns:
Pointer to the Script on success, NULL on failure.

Definition at line 148 of file ScriptManager.cpp.

Script * ScriptManager::createScriptFromFile ( const std::string &  fileName  ) 

Creates an script with the given name, loaded from the given file.

Parameters:
fileName Filename of the file to load.
Returns:
Pointer to the Script on success, NULL on failure.

Definition at line 161 of file ScriptManager.cpp.

asIScriptEngine * ScriptManager::getEngine (  )  const

Returns a direct pointer to the AngelScript engine.

Note:
Not available in AngelScript.

Definition at line 97 of file ScriptManager.cpp.

Script * ScriptManager::getScript ( const std::string &  name  ) 

Gets the Script with the given name.

Returns:
Pointer to the Script if found, else NULL.

Definition at line 194 of file ScriptManager.cpp.

Script * ScriptManager::getScript ( const u32  id  ) 

Gets the Script with the given ID.

Returns:
Pointer to the Script if found, else NULL.

Definition at line 182 of file ScriptManager.cpp.

void ScriptManager::init (  ) 

Initialises the ScriptManager.

Definition at line 35 of file ScriptManager.cpp.

void ScriptManager::refAdd (  ) 

Increases the reference counter.

Note:
For internal use only!

Definition at line 85 of file ScriptManager.cpp.

void ScriptManager::refRelease (  ) 

Decreases the reference counter.

Note:
For internal use only!

Definition at line 91 of file ScriptManager.cpp.

void ScriptManager::removeAllScripts (  ) 

Removes all scripts from the ScriptManager.

Definition at line 206 of file ScriptManager.cpp.

void ScriptManager::removeAllScriptSections (  ) 

Removes all script sections from the ScriptManager.

Definition at line 215 of file ScriptManager.cpp.

bool ScriptManager::removeScript ( const std::string &  name  ) 

Removes the given Script with the given name.

Parameters:
name Name of the Script to remove.
Returns:
True if removal was successful, false if removal was a failure.

Definition at line 269 of file ScriptManager.cpp.

bool ScriptManager::removeScript ( const u32  id  ) 

Removes the given Script with the given ID.

Parameters:
id ID of the Script to remove.
Returns:
True if removal was successful, false if removal was a failure.

Definition at line 247 of file ScriptManager.cpp.

bool ScriptManager::removeScript ( Script script  ) 

Removes the given Script.

Parameters:
script Pointer to the Script to remove.
Returns:
True if removal was successful, false if removal was a failure.

Definition at line 221 of file ScriptManager.cpp.

bool ScriptManager::removeScriptSection ( const std::string &  name  ) 

Removes the script section with the given name.

Parameters:
name Name of the script section to remove.

Definition at line 291 of file ScriptManager.cpp.


Friends And Related Function Documentation

friend class Script [friend]

Definition at line 34 of file ScriptManager.h.


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

Generated on Wed Jun 10 22:26:26 2009 for Sirrf - Simple Irrlicht Framework by  doxygen 1.5.8