Cocos2d-x  v4
SchedulerScriptHandlerEntry Class Reference

The SchedulerScriptHandlerEntry is used to store the handler corresponding to the Lua function pointer and assign the handler a unique id like ScriptHandlerEntry. More...

Inherits ScriptHandlerEntry.

Public Member Functions

virtual ~SchedulerScriptHandlerEntry ()
 Destructor of SchedulerScriptHandlerEntry. More...
 
TimerScriptHandler * getTimer ()
 Get the pointer of TimerScriptHandler object. More...
 
bool isPaused ()
 Get the flag whether paused or not. More...
 
void markedForDeletion ()
 Set the markedForDeletion flag true. More...
 
bool isMarkedForDeletion ()
 Get the flag whether markedForDeletion or not. More...
 
- Public Member Functions inherited from ScriptHandlerEntry
virtual ~ScriptHandlerEntry ()
 Destructor of ScriptHandlerEntry. More...
 
int getHandler ()
 Get the handler corresponding to the Lua function pointer. More...
 
int getEntryId ()
 Get the unique id corresponding to the handler. More...
 
- Public Member Functions inherited from Ref
void retain ()
 Retains the ownership. More...
 
void release ()
 Releases the ownership immediately. More...
 
Refautorelease ()
 Releases the ownership sometime soon automatically. More...
 
unsigned int getReferenceCount () const
 Returns the Ref's current reference count. More...
 
virtual ~Ref ()
 Destructor. More...
 

Static Public Member Functions

static SchedulerScriptHandlerEntrycreate (int handler, float interval, bool paused)
 create a SchedulerScriptHandlerEntry object. More...
 
- Static Public Member Functions inherited from ScriptHandlerEntry
static ScriptHandlerEntrycreate (int handler)
 create a ScriptHandlerEntry instance by the handler. More...
 

Additional Inherited Members

- Public Attributes inherited from Ref
unsigned int _ID
 object id, ScriptSupport need public _ID
 
int _luaID
 Lua reference id.
 
void * _scriptObject
 scriptObject, support for swift
 
bool _rooted
 When true, it means that the object was already rooted.
 

Detailed Description

The SchedulerScriptHandlerEntry is used to store the handler corresponding to the Lua function pointer and assign the handler a unique id like ScriptHandlerEntry.

Meanwhile,create a timer that named TimerScriptHandler to execute the Lua function corresponding to the handler in the interval time if the SchedulerScriptHandlerEntry object isn't paused. @js NA

Constructor & Destructor Documentation

◆ ~SchedulerScriptHandlerEntry()

virtual ~SchedulerScriptHandlerEntry ( )
virtual

Destructor of SchedulerScriptHandlerEntry.

@js NA @lua NA

Member Function Documentation

◆ create()

static SchedulerScriptHandlerEntry* create ( int  handler,
float  interval,
bool  paused 
)
static

create a SchedulerScriptHandlerEntry object.

Parameters
handlerthe index corresponding to the Lua function pointer.
intervalthe interval to execute the Lua function. If the value is 0, then the lua function will be scheduled every frame.
pausedif paused is true, then the timer won't be started until it is resumed.
Returns
a SchedulerScriptHandlerEntry object. @js NA @lua NA

◆ getTimer()

TimerScriptHandler* getTimer ( )
inline

Get the pointer of TimerScriptHandler object.

Returns
the pointer of TimerScriptHandler object. @js NA @lua NA

◆ isPaused()

bool isPaused ( )
inline

Get the flag whether paused or not.

Returns
the flag whether paused or not. @js NA @lua NA

◆ markedForDeletion()

void markedForDeletion ( )
inline

Set the markedForDeletion flag true.

@js NA @lua NA

◆ isMarkedForDeletion()

bool isMarkedForDeletion ( )
inline

Get the flag whether markedForDeletion or not.

Returns
the flag whether markedForDeletion or not. @js NA @lua NA

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