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

Public Member Functions

 ScriptEngine (Kernel *KernelPtr)
 
virtual bool init ()=0
 
virtual bool executeFile (const Common::String &fileName)=0
 
virtual bool executeString (const Common::String &code)=0
 
virtual void * getScriptObject ()=0
 
virtual void setCommandLine (const Common::Array< Common::String > &commandLineParameters)=0
 
bool persist (OutputPersistenceBlock &writer) override=0
 
bool unpersist (InputPersistenceBlock &reader) override=0
 

Additional Inherited Members

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

Member Function Documentation

◆ init()

virtual bool Sword25::ScriptEngine::init ( )
pure virtual

Initializes the scrip tengine. Returns true if successful, false otherwise.

Implemented in Sword25::LuaScriptEngine.

◆ executeFile()

virtual bool Sword25::ScriptEngine::executeFile ( const Common::String fileName)
pure virtual

Loads a script file and executes it.

Parameters
FileNameThe script filename

Implemented in Sword25::LuaScriptEngine.

◆ executeString()

virtual bool Sword25::ScriptEngine::executeString ( const Common::String code)
pure virtual

Executes a specified script fragment

Parameters
CodeString of script code

Implemented in Sword25::LuaScriptEngine.

◆ getScriptObject()

virtual void* Sword25::ScriptEngine::getScriptObject ( )
pure virtual

Returns a pointer to the main object of the script engine Note: Using this method breaks the encapsulation of the language from the rest of the engine.

Implemented in Sword25::LuaScriptEngine.

◆ setCommandLine()

virtual void Sword25::ScriptEngine::setCommandLine ( const Common::Array< Common::String > &  commandLineParameters)
pure virtual

Makes the command line parameters for the script environment available Note: How the command line parameters will be used by scripts is dependant on the particular implementation.

Parameters
CommandLineParametersList containing the command line parameters

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