cocos2d-x  3.0-alpha0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ScriptEngineProtocol Class Referenceabstract

#include <CCScriptSupport.h>

Inheritance diagram for ScriptEngineProtocol:
LuaEngine

Public Member Functions

virtual ~ScriptEngineProtocol ()
virtual ccScriptType getScriptType ()
 Get script type. More...
 
virtual void removeScriptObjectByObject (Object *pObj)=0
 Remove script object. More...
 
virtual void removeScriptHandler (int nHandler)
 Remove script function handler, only LuaEngine class need to implement this function. More...
 
virtual int reallocateScriptHandler (int nHandler)
 Reallocate script function handler, only LuaEngine class need to implement this function. More...
 
virtual int executeString (const char *codes)=0
 Execute script code contained in the given string. More...
 
virtual int executeScriptFile (const char *filename)=0
 Execute a script file. More...
 
virtual int executeGlobalFunction (const char *functionName)=0
 Execute a scripted global function. More...
 
virtual int sendEvent (ScriptEvent *evt)=0
 when trigger a script event ,call this func,add params needed into ScriptEvent object.nativeObject is object triggering the event, can be NULL in lua More...
 
virtual bool handleAssert (const char *msg)=0
 called by CCAssert to allow scripting engine to handle failed assertions More...
 

Constructor & Destructor Documentation

virtual ~ScriptEngineProtocol ( )
inlinevirtual

Member Function Documentation

virtual int executeGlobalFunction ( const char *  functionName)
pure virtual

Execute a scripted global function.

The function should not take any parameters and should return an integer.

Parameters
functionNameString object holding the name of the function, in the global script environment, that is to be executed.
Returns
The integer value returned from the script function.

Implemented in LuaEngine.

virtual int executeScriptFile ( const char *  filename)
pure virtual

Execute a script file.

Parameters
filenameString object holding the filename of the script file that is to be executed

Implemented in LuaEngine.

virtual int executeString ( const char *  codes)
pure virtual

Execute script code contained in the given string.

Parameters
codesholding the valid script code that should be executed.
Returns
0 if the string is executed correctly.
other if the string is executed wrongly.

Implemented in LuaEngine.

virtual ccScriptType getScriptType ( )
inlinevirtual

Get script type.

Reimplemented in LuaEngine.

virtual bool handleAssert ( const char *  msg)
pure virtual

called by CCAssert to allow scripting engine to handle failed assertions

Returns
true if the assert was handled by the script engine, false otherwise.

Implemented in LuaEngine.

virtual int reallocateScriptHandler ( int  nHandler)
inlinevirtual

Reallocate script function handler, only LuaEngine class need to implement this function.

Reimplemented in LuaEngine.

virtual void removeScriptHandler ( int  nHandler)
inlinevirtual

Remove script function handler, only LuaEngine class need to implement this function.

Reimplemented in LuaEngine.

virtual void
removeScriptObjectByObject
( Object pObj)
pure virtual

Remove script object.

Implemented in LuaEngine.

virtual int sendEvent ( ScriptEvent evt)
pure virtual

when trigger a script event ,call this func,add params needed into ScriptEvent object.nativeObject is object triggering the event, can be NULL in lua

Implemented in LuaEngine.


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