Don't make ScriptEngineProtocol inherits from Object since setScriptEngine is invoked only once in AppDelegate.cpp, It will affect the lifecycle of ScriptEngine instance, the autorelease pool will be destroyed before destructing ScriptEngine.
More...
Inherited by LuaEngine.
Don't make ScriptEngineProtocol inherits from Object since setScriptEngine is invoked only once in AppDelegate.cpp, It will affect the lifecycle of ScriptEngine instance, the autorelease pool will be destroyed before destructing ScriptEngine.
So a crash will appear on Win32 if you click the close button.
| virtual ccScriptType getScriptType |
( |
| ) |
|
|
inlinevirtual |
Get the specific script type.
- Returns
- the specific script type.
Reimplemented in LuaEngine.
virtual void
removeScriptObjectByObject |
( |
Ref * |
obj | ) |
|
|
pure virtual |
| virtual void removeScriptHandler |
( |
int |
handler | ) |
|
|
inlinevirtual |
| virtual int reallocateScriptHandler |
( |
int |
handler | ) |
|
|
inlinevirtual |
| virtual int executeString |
( |
const char * |
codes | ) |
|
|
pure virtual |
Execute script code contained in the given string.
- Parameters
-
| codes | holding 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 int executeScriptFile |
( |
const char * |
filename | ) |
|
|
pure virtual |
Execute a script file.
- Parameters
-
| filename | String object holding the filename of the script file that is to be executed. |
- Returns
- 0 if it happen the error or it hasn't return value, otherwise it return the value by calling the lua function.
Implemented in LuaEngine.
| 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
-
| functionName | String 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 bool handleAssert |
( |
const char * |
msg | ) |
|
|
pure virtual |
Handle the assert message.
- Returns
- true if the assert was handled by the script engine, false otherwise.
Implemented in LuaEngine.
| virtual bool parseConfig |
( |
ConfigType |
type, |
|
|
const std::string & |
str |
|
) |
| |
|
pure virtual |
Parse configuration file.
- Parameters
-
| type | the specific type value. |
| str | the information data. |
Implemented in LuaEngine.
The documentation for this class was generated from the following file: