public void Update(Racer r) { if (!CheckUpdateable(r)) { Init(r); } else { DataCollection next = (DataCollection)data[0].Clone(); next.Update(r); float timestamp = next.GetValue(r, Addr.Pod.TimeTotal); bool timestamp_exists = false; for (int i = 0; i < data.Count; i++) { float timestamp_frame = data[i].GetValue(r, Addr.Pod.TimeTotal); if (timestamp_frame > timestamp) { data.RemoveAt(i); } if (timestamp_frame == timestamp) { timestamp_exists = true; } } if (!timestamp_exists) { data.Add(next); } } }
public void Update(Racer r) { data_prev = (DataCollection)data.Clone(); data.Update(r); }