Beispiel #1
0
 public virtual void Update(LTimerContext context)
 {
     if (_closed)
     {
         return;
     }
     if (_loop_timer.Action(context))
     {
         if (_scheduled.size > 0)
         {
             bool     seq   = (_forceWaitSequence && _removeSequenceTask);
             int      index = seq ? 0 : MathUtils.Max(0, _childIndex);
             Interval i     = _scheduled.Get(index);
             if (i != null)
             {
                 if (i._loop_timer.Action(context))
                 {
                     i.Loop();
                 }
                 if (_forceWaitSequence)
                 {
                     if (i.Completed())
                     {
                         if (_removeSequenceTask)
                         {
                             _scheduled.RemoveFirst();
                         }
                         else
                         {
                             _childIndex++;
                         }
                     }
                     else if (i.Completed() && !seq)
                     {
                         _childIndex++;
                     }
                 }
                 else
                 {
                     if (_removeSequenceTask)
                     {
                         _scheduled.RemoveFirst();
                     }
                     else
                     {
                         _childIndex++;
                     }
                 }
             }
             if (_childIndex >= _scheduled.size)
             {
                 _childIndex = 0;
             }
         }
     }
 }
Beispiel #2
0
 public override void Run(LTimerContext time)
 {
     if (sched != null)
     {
         sched.Update(time);
         if (sched.Completed())
         {
             Kill();
         }
     }
 }
Beispiel #3
0
 public override void Run(LTimerContext time)
 {
     if (timer != null)
     {
         timer.Action(time);
         if (timer.IsClosed() || timer.IsCompleted())
         {
             Kill();
         }
     }
 }
Beispiel #4
0
 public virtual LTimer AddPercentage(LTimerContext context)
 {
     this._currentTick += context.timeSinceLastUpdate;
     return(this);
 }
Beispiel #5
0
 public virtual bool Action(LTimerContext context)
 {
     return(Action(context.timeSinceLastUpdate));
 }