Exemplo n.º 1
0
 float?Apex.LoadBalancing.ILoadBalanced.ExecuteUpdate(float deltaTime, float nextInterval)
 {
     this.repeat = this._action(deltaTime);
     if (!this.repeat)
     {
         LoadBalancedActionPool.Return(this);
     }
     return(null);
 }
            float?ILoadBalanced.ExecuteUpdate(float deltaTime, float nextInterval)
            {
                bool moreWork = true;

                _watch.Reset();
                _watch.Start();
                while (moreWork && _watch.ElapsedMilliseconds < _maxMillisecondsUsedPerFrame)
                {
                    moreWork = _iter.MoveNext();
                }

                this.repeat = moreWork;
                if (!moreWork)
                {
                    LoadBalancedActionPool.Return(this);
                }

                return(0f);
            }
Exemplo n.º 3
0
 float?ILoadBalanced.ExecuteUpdate(float deltaTime, float nextInterval)
 {
     _action();
     LoadBalancedActionPool.Return(this);
     return(null);
 }
Exemplo n.º 4
0
 public static ILoadBalancedHandle Execute(this ILoadBalancer lb, Func <float, bool> action, float interval, float delayFirstUpdateBy)
 {
     return(lb.Add(LoadBalancedActionPool.GetAction(action), interval, delayFirstUpdateBy));
 }
Exemplo n.º 5
0
 public static ILoadBalancedHandle Execute(this ILoadBalancer lb, Func <float, bool> action, bool delayFirstUpdate = false)
 {
     return(lb.Add(LoadBalancedActionPool.GetAction(action), delayFirstUpdate));
 }