ScummVM API documentation
Sword25::LuaScriptEngine Class Reference
Inheritance diagram for Sword25::LuaScriptEngine:
Sword25::ScriptEngine Sword25::Service Sword25::Persistable

Public Member Functions

 LuaScriptEngine (Kernel *KernelPtr)
 
bool init () override
 
bool executeFile (const Common::String &fileName) override
 
bool executeString (const Common::String &code) override
 
void * getScriptObject () override
 
void setCommandLine (const Common::StringArray &commandLineParameters) override
 
bool persist (OutputPersistenceBlock &writer) override
 
bool unpersist (InputPersistenceBlock &reader) override
 
- Public Member Functions inherited from Sword25::ScriptEngine
 ScriptEngine (Kernel *KernelPtr)
 
virtual void setCommandLine (const Common::Array< Common::String > &commandLineParameters)=0
 

Additional Inherited Members

- Protected Member Functions inherited from Sword25::Service
 Service (Kernel *pKernel)
 
KernelGetKernel () const
 

Member Function Documentation

◆ init()

bool Sword25::LuaScriptEngine::init ( )
overridevirtual

Initializes the scripting engine

Returns
Returns true if successful, otherwise false.

Implements Sword25::ScriptEngine.

◆ executeFile()

bool Sword25::LuaScriptEngine::executeFile ( const Common::String fileName)
overridevirtual

Loads a script file and executes it

Parameters
FileNameThe filename of the script
Returns
Returns true if successful, otherwise false.

Implements Sword25::ScriptEngine.

◆ executeString()

bool Sword25::LuaScriptEngine::executeString ( const Common::String code)
overridevirtual

Execute a string of script code

Parameters
CodeA string of script code
Returns
Returns true if successful, otherwise false.

Implements Sword25::ScriptEngine.

◆ getScriptObject()

void* Sword25::LuaScriptEngine::getScriptObject ( )
inlineoverridevirtual

Returns a pointer to the main object of the scripting language

Remarks
Using this method breaks the encapsulation of the language

Implements Sword25::ScriptEngine.

◆ setCommandLine()

void Sword25::LuaScriptEngine::setCommandLine ( const Common::StringArray commandLineParameters)
override

Makes the command line parameters for the scripting environment available

Parameters
CommandLineParametersAn array containing all the command line parameters
Remarks
How the command line parameters will be used by scripts is dependant on the particular implementation.

◆ persist()

bool Sword25::LuaScriptEngine::persist ( OutputPersistenceBlock writer)
overridevirtual
Remarks
The Lua stack is cleared by this method

Implements Sword25::ScriptEngine.

◆ unpersist()

bool Sword25::LuaScriptEngine::unpersist ( InputPersistenceBlock reader)
overridevirtual
Remarks
The Lua stack is cleared by this method

Implements Sword25::ScriptEngine.


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