Пример #1
0
 public static void PostPathTime(PathTime pathTime)
 {
     _pathTimes.Add(pathTime);
     UpdateRanks();
 }
Пример #2
0
 private void FinishRace()
 {
     timer.Stop();
     end = DateTime.Now;
     splitTimes.Last().Time = end.Value.Subtract(start.Value);
     racing = false;
     watcher.Stop();
     FinishTime.Text = PathUtil.FormatTimeSpan(end.Value.Subtract(start.Value));
     var result = new PathTime
                      {
                          PathKey = currentCourse.Key,
                          Mode = mode,
                          User = "******",
                          SplitTimes = splitTimes.Where(s => s.Time.HasValue).Select(s => s.Time.Value).ToArray(),
                          TotalTime = end.Value.Subtract(start.Value)
                      };
     DataAccess.PostPathTime(result);
     DataAccess.Save();
 }