Class Index | File Index

Classes


Class CAAT.Foundation.Timer.TimerManager


Defined in: TimerManager.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Field Summary
Field Attributes Field Name and Description
<private>  
Collection of registered timers.
<private>  
Index sequence to idenfity registered timers.
Method Summary
Method Attributes Method Name and Description
<private>  
 
Check and apply timers in frame time.
 
createTimer(startTime, duration, callback_timeout, callback_tick, callback_cancel, scene)
Creates a timer task.
 
ensureTimerTask(timertask)
Make sure the timertask is contained in the timer task list by adding it to the list in case it is not contained.
 
hasTimer(timertask)
Check whether the timertask is in this scene's timer task list.
 
Removes expired timers.
Class Detail
CAAT.Foundation.Timer.TimerManager()
Field Detail
<private> timerList
Collection of registered timers.

<private> timerSequence
Index sequence to idenfity registered timers.
Method Detail
<private> __init()

checkTimers(time)
Check and apply timers in frame time.
Parameters:
time
{number} the current Scene time.

{CAAT.TimerTask} createTimer(startTime, duration, callback_timeout, callback_tick, callback_cancel, scene)
Creates a timer task. Timertask object live and are related to scene's time, so when an Scene is taken out of the Director the timer task is paused, and resumed on Scene restoration.
Parameters:
startTime
{number} an integer indicating the scene time this task must start executing at.
duration
{number} an integer indicating the timerTask duration.
callback_timeout
{function} timer on timeout callback function.
callback_tick
{function} timer on tick callback function.
callback_cancel
{function} timer on cancel callback function.
scene
Returns:
{CAAT.TimerTask} a CAAT.TimerTask class instance.

ensureTimerTask(timertask)
Make sure the timertask is contained in the timer task list by adding it to the list in case it is not contained.
Parameters:
timertask
{CAAT.Foundation.Timer.TimerTask}.
Returns:
this

{boolean} hasTimer(timertask)
Check whether the timertask is in this scene's timer task list.
Parameters:
timertask
{CAAT.Foundation.Timer.TimerTask}.
Returns:
{boolean} a boolean indicating whether the timertask is in this scene or not.

removeExpiredTimers()
Removes expired timers. This method must not be called directly.

Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:18 GMT-0700 (PDT)