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)); } } } }
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)); } } }
public void Simulate(float normalizedTime, TickObjectEnumerator etor) { Simulate(this, normalizedTime, etor); }
public void ApplyDeltaForPredict(TickObjectEnumerator etor) { ApplyDeltaForPredict(this, etor); }
public void FullUpdate(TickObjectEnumerator etor) { FullUpdate(this, etor); }
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)); } } } }