cocos2d-x  2.2.3-gd2.113-rev1ec524e
Loading...
Searching...
No Matches
CCScriptEngineProtocol Class Referenceabstract

NA NA. More...

#include <CCScriptSupport.h>

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
 

Detailed Description

NA NA.

Member Enumeration Documentation

◆ ConfigType

enum ConfigType
Enumerator
NONE 
COCOSTUDIO 

Constructor & Destructor Documentation

◆ ~CCScriptEngineProtocol()

virtual ~CCScriptEngineProtocol ( )
inlinevirtual

Member Function Documentation

◆ executeAccelerometerEvent()

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

execute a accelerometer event

◆ executeCallFuncActionEvent()

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

execute a callfun event

◆ executeEvent()

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

function for common event

◆ executeEventWithArgs()

virtual int executeEventWithArgs ( int  nHandler,
CCArray pArgs 
)
inlinevirtual

function for c++ call back lua funtion

◆ executeGlobalFunction()

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.

◆ executeLayerKeypadEvent()

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

functions for keypad event

◆ executeLayerTouchesEvent()

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

functions for executing touch event

◆ executeLayerTouchEvent()

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

◆ executeMenuItemEvent()

virtual int executeMenuItemEvent ( CCMenuItem pMenuItem)
pure virtual

◆ executeNodeEvent()

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.

◆ executeNotificationEvent()

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

Execute a notification event function.

◆ executeSchedule()

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

execute a schedule function

◆ executeScriptFile()

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

◆ executeString()

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.

◆ getScriptType()

virtual ccScriptType getScriptType ( )
inlinevirtual

Get script type.

◆ handleAssert()

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.

◆ parseConfig()

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

◆ reallocateScriptHandler()

virtual int reallocateScriptHandler ( int  nHandler)
inlinevirtual

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

◆ removeScriptHandler()

virtual void removeScriptHandler ( int  nHandler)
inlinevirtual

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

◆ removeScriptObjectByCCObject()

virtual void removeScriptObjectByCCObject ( CCObject pObj)
pure virtual

Remove script object.


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