コード例 #1
0
 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);
         }
     }
 }
コード例 #2
0
ファイル: Racer.GameState.cs プロジェクト: everalert/swe1r
 public void Update(Racer r)
 {
     data_prev = (DataCollection)data.Clone();
     data.Update(r);
 }