ScriptManager Class Reference

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

Inheritance diagram for ScriptManager:

Inheritance graph
[legend]
Collaboration diagram for ScriptManager:

Collaboration graph
[legend]

List of all members.

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 &section)
 Adds a script section to the ScriptManager. These script sections are added to all scripts.
ScriptcreateScript (const std::string &name, bool grab=true)
 Creates (and adds) an script with the given name.
ScriptcreateScriptFromFile (const std::string &fileName, bool grab=true)
 Creates an script with the given name, loaded from the given file.
ScriptcreateScriptFromFile (IReadFile *file, bool grab=true)
 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 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


Detailed Description

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

Definition at line 34 of file ScriptManager.h.


Constructor & Destructor Documentation

ScriptManager::ScriptManager (  ) 

Constructor.

Definition at line 52 of file ScriptManager.cpp.

ScriptManager::~ScriptManager (  ) 

Deconstructor.

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

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

Definition at line 161 of file ScriptManager.cpp.

void ScriptManager::clear (  ) 

Clears the ScriptManager.

Definition at line 112 of file ScriptManager.cpp.

Script * ScriptManager::createScript ( const std::string &  name,
bool  grab = true 
)

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

Parameters:
name Name of the script.
grab Should the ScriptManager add the loaded script to the internal list?
Returns:
Pointer to the Script on success, NULL on failure.

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.

Parameters:
file Pointer to the IReadFile that will be used.
grab Should the ScriptManager add the loaded script to the internal list?
Returns:
Pointer to the Script on success, NULL on failure.

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.

Parameters:
fileName Filename of the file to load.
grab Should the ScriptManager add the loaded script to the internal list?
Returns:
Pointer to the Script on success, NULL on failure.

Definition at line 208 of file ScriptManager.cpp.

void ScriptManager::drop (  )  [virtual]

Decreases the reference counter.

Note:
This is a dummy function.

Reimplemented from ReferenceCounted.

Definition at line 131 of file ScriptManager.cpp.

asIScriptEngine * ScriptManager::getEngine (  )  const

Returns a direct pointer to the AngelScript engine.

Note:
Not available in AngelScript.

Definition at line 137 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 268 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 256 of file ScriptManager.cpp.

void ScriptManager::grab (  )  [virtual]

Increases the reference counter.

Note:
This is a dummy function.

Reimplemented from ReferenceCounted.

Definition at line 125 of file ScriptManager.cpp.

void ScriptManager::init (  ) 

Initialises the ScriptManager.

Definition at line 62 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 343 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 321 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 295 of file ScriptManager.cpp.

void ScriptManager::removeScripts (  ) 

Removes all scripts from the ScriptManager.

Definition at line 280 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 365 of file ScriptManager.cpp.

void ScriptManager::removeScriptSections (  ) 

Removes all script sections from the ScriptManager.

Definition at line 289 of file ScriptManager.cpp.


Friends And Related Function Documentation

friend class Script [friend]

Definition at line 36 of file ScriptManager.h.


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

Generated on Fri Aug 21 23:55:17 2009 for Sirrf - Simple Irrlicht Framework by  doxygen 1.5.8