commit 4083e2c46f056c7d75b8de7fe4309814312d78a2
| author | 斟酌 鵬兄 <tgckpg@gmail.com> |
| date | 2016-04-04T22:48:02Z |
| subject | Minor Bug fix |
commit 4083e2c46f056c7d75b8de7fe4309814312d78a2
Author: 斟酌 鵬兄 <tgckpg@gmail.com>
Date: 2016-04-04T22:48:02Z
Minor Bug fix
---
botanjs/src/System/Cycle/_this.js | 21 ++++++++++++++-------
1 file changed, 14 insertions(+), 7 deletions(-)
diff --git a/botanjs/src/System/Cycle/_this.js b/botanjs/src/System/Cycle/_this.js
index f31bb5c..02cd746 100644
--- a/botanjs/src/System/Cycle/_this.js
+++ b/botanjs/src/System/Cycle/_this.js
@@ -19,11 +19,6 @@
var stepper = function()
{
var thisTime = new Date().getTime();
- // 0: Callback
- // 1: scheduled run time
- // 2: Permanent
- // ( 3: id )
- // 4: interval
for ( var i in tList )
{
var f = tList[i];
@@ -55,7 +50,12 @@
// Should bind "func" before register
var registerDelay = function (func, milliSec)
{
- tList[ tList.length ] = [ func, new Date().getTime() + milliSec, true ];
+ var a = [];
+ a[ C_CALLBACK ] = func;
+ a[ C_TIME ] = new Date().getTime() + milliSec;
+ a[ C_ONCE ] = true;
+
+ tList[ tList.length ] = a;
};
var registerPermanentTicker = function ( id, func, interval )
@@ -66,7 +66,14 @@
return false;
}
- tList[ tList.length ] = [ func, new Date().getTime() + interval, false, id, interval ];
+ var a = [];
+ a[ C_CALLBACK ] = func;
+ a[ C_TIME ] = new Date().getTime() + interval;
+ a[ C_ONCE ] = false;
+ a[ C_ID ] = id;
+ a[ C_INTVL ] = interval;
+
+ tList[ tList.length ] = a;
};
var deletePermanentTicker = function ( id )