cocos2d-x  2.2.6
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
CCScriptEngineProtocol Class Referenceabstract

#include <CCScriptSupport.h>

Inheritance diagram for CCScriptEngineProtocol:
CCLuaEngine

Public Types

enum  ConfigType { NONE, COCOSTUDIO }
 

Public Member Functions

virtual ~CCScriptEngineProtocol ()
virtual ccScriptType getScriptType ()
 Get script type. More...
 
virtual void removeScriptObjectByCCObject (CCObject *pObj)=0
 Remove script object. More...
 
virtual void removeScriptHandler (int nHandler)
 Remove script function handler, only CCLuaEngine class need to implement this function. More...
 
virtual int reallocateScriptHandler (int nHandler)
 Reallocate script function handler, only CCLuaEngine 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 executeNodeEvent (CCNode *pNode, int nAction)=0
 Execute a node event function. More...
 
virtual int executeMenuItemEvent (CCMenuItem *pMenuItem)=0
virtual int executeNotificationEvent (CCNotificationCenter *pNotificationCenter, const char *pszName)=0
 Execute a notification event function. More...
 
virtual int executeCallFuncActionEvent (CCCallFunc *pAction, CCObject *pTarget=NULL)=0
 execute a callfun event More...
 
virtual int executeSchedule (int nHandler, float dt, CCNode *pNode=NULL)=0
 execute a schedule function More...
 
virtual int executeLayerTouchesEvent (CCLayer *pLayer, int eventType, CCSet *pTouches)=0
 functions for executing touch event More...
 
virtual int executeLayerTouchEvent (CCLayer *pLayer, int eventType, CCTouch *pTouch)=0
virtual int executeLayerKeypadEvent (CCLayer *pLayer, int eventType)=0
 functions for keypad event More...
 
virtual int executeAccelerometerEvent (CCLayer *pLayer, CCAcceleration *pAccelerationValue)=0
 execute a accelerometer event More...
 
virtual int executeEvent (int nHandler, const char *pEventName, CCObject *pEventSource=NULL, const char *pEventSourceClassName=NULL)=0
 function for common event More...
 
virtual int executeEventWithArgs (int nHandler, CCArray *pArgs)
 function for c++ call back lua funtion More...
 
virtual bool handleAssert (const char *msg)=0
 called by CCAssert to allow scripting engine to handle failed assertions More...
 
virtual bool parseConfig (ConfigType type, const std::string &str)=0

Member Enumeration Documentation

enum ConfigType
Enumerator
NONE 
COCOSTUDIO 

Constructor & Destructor Documentation

virtual ~CCScriptEngineProtocol ( )
inlinevirtual

Member Function Documentation

virtual int
executeAccelerometerEvent
( CCLayer pLayer,
CCAcceleration pAccelerationValue 
)
pure virtual

execute a accelerometer event

Implemented in CCLuaEngine.

virtual int
executeCallFuncActionEvent
( CCCallFunc pAction,
CCObject pTarget = NULL 
)
pure virtual

execute a callfun event

Implemented in CCLuaEngine.

virtual int executeEvent ( int  nHandler,
const char *  pEventName,
CCObject pEventSource = NULL,
const char *  pEventSourceClassName = NULL 
)
pure virtual

function for common event

Implemented in CCLuaEngine.

virtual int executeEventWithArgs ( int  nHandler,
CCArray pArgs 
)
inlinevirtual

function for c++ call back lua funtion

Reimplemented in CCLuaEngine.

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 CCLuaEngine.

virtual int executeLayerKeypadEvent ( CCLayer pLayer,
int  eventType 
)
pure virtual

functions for keypad event

Implemented in CCLuaEngine.

virtual int
executeLayerTouchesEvent
( CCLayer pLayer,
int  eventType,
CCSet pTouches 
)
pure virtual

functions for executing touch event

Implemented in CCLuaEngine.

virtual int executeLayerTouchEvent ( CCLayer pLayer,
int  eventType,
CCTouch pTouch 
)
pure virtual

Implemented in CCLuaEngine.

virtual int executeMenuItemEvent ( CCMenuItem pMenuItem)
pure virtual

Implemented in CCLuaEngine.

virtual int executeNodeEvent ( CCNode pNode,
int  nAction 
)
pure virtual

Execute a node event function.

Parameters
pNodewhich node produce this event
nActionkCCNodeOnEnter,kCCNodeOnExit,kCCMenuItemActivated,kCCNodeOnEnterTransitionDidFinish,kCCNodeOnExitTransitionDidStart
Returns
The integer value returned from the script function.

Implemented in CCLuaEngine.

virtual int
executeNotificationEvent
( CCNotificationCenter pNotificationCenter,
const char *  pszName 
)
pure virtual

Execute a notification event function.

Implemented in CCLuaEngine.

virtual int executeSchedule ( int  nHandler,
float  dt,
CCNode pNode = NULL 
)
pure virtual

execute a schedule function

Implemented in CCLuaEngine.

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 CCLuaEngine.

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 CCLuaEngine.

virtual ccScriptType getScriptType ( )
inlinevirtual

Get script type.

Reimplemented in CCLuaEngine.

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 CCLuaEngine.

virtual bool parseConfig ( ConfigType  type,
const std::string &  str 
)
pure virtual

Implemented in CCLuaEngine.

virtual int reallocateScriptHandler ( int  nHandler)
inlinevirtual

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

Reimplemented in CCLuaEngine.

virtual void removeScriptHandler ( int  nHandler)
inlinevirtual

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

Reimplemented in CCLuaEngine.

virtual void
removeScriptObjectByCCObject
( CCObject pObj)
pure virtual

Remove script object.

Implemented in CCLuaEngine.


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