Пример #1
0
 static void FullUpdate(IDictionary <int, ITickObjectClient> dict, TickObjectEnumerator etor)
 {
     while (etor.MoveNext())
     {
         TickObject        obj = etor.Current;
         ITickObjectClient tickobject;
         if (dict.TryGetValue(obj.Id, out tickobject))
         {
             tickobject.FullUpdate(obj);
             if (obj.TickObjectLength > 0 && null != tickobject.children)
             {
                 FullUpdate(tickobject.children, new TickObjectEnumerator(obj));
             }
         }
     }
 }
Пример #2
0
 static void ApplyDeltaForPredict(IDictionary <int, ITickObjectClient> dict, TickObjectEnumerator etor)
 {
     while (etor.MoveNext())
     {
         TickObject        obj = etor.Current;
         ITickObjectClient tickobject;
         if (dict.TryGetValue(obj.Id, out tickobject) && tickobject.predict)
         {
             tickobject.ApplyDeltaForPredict(obj);
         }
         if (obj.TickObjectLength > 0 && null != tickobject.children)
         {
             ApplyDeltaForPredict(tickobject.children, new TickObjectEnumerator(obj));
         }
     }
 }
Пример #3
0
 public void Simulate(float normalizedTime, TickObjectEnumerator etor)
 {
     Simulate(this, normalizedTime, etor);
 }
Пример #4
0
 public void ApplyDeltaForPredict(TickObjectEnumerator etor)
 {
     ApplyDeltaForPredict(this, etor);
 }
Пример #5
0
 public void FullUpdate(TickObjectEnumerator etor)
 {
     FullUpdate(this, etor);
 }
Пример #6
0
        static void Simulate(IDictionary <int, ITickObjectClient> dict, float normalizedTime, TickObjectEnumerator etor)
        {
            TickEvent ev         = InstancePool.Get <TickEvent>();
            uint      serverTick = SyncManagerClient.Instance.serverTick;

            while (etor.MoveNext())
            {
                TickObject        obj = etor.Current;
                ITickObjectClient tickObject;
                if (dict.TryGetValue(obj.Id, out tickObject))
                {
                    for (int i = 0; i < obj.EventsLength; ++i)
                    {
                        obj.GetEvents(ev, i);
                        if (serverTick == ev.Tick)
                        {
                            tickObject.EventUpdate(ev);
                            break;
                        }
                    }

                    if (!tickObject.predict)
                    {
                        tickObject.Lerping(normalizedTime, obj);
                    }

                    if (obj.TickObjectLength > 0 && null != tickObject.children)
                    {
                        Simulate(tickObject.children, normalizedTime, new TickObjectEnumerator(obj));
                    }
                }
            }
        }