Example #1
0
 private void GenerateLapTimes()
 {
     for (int i = 0; i < CarStates.Count - 1; i++)
     {
         var lapTime = Lap.GetLapTimeUsingCarStates(CarStates[i], CarStates[i + 1]);
         LapTimes.Add(lapTime);
     }
 }
Example #2
0
        private void CalculateTime()
        {
            TotalTime = new TimeSpan();
            var reversedCarStates = new List <CarState>(CarStates);

            reversedCarStates.Reverse();
            for (int i = 0; i < reversedCarStates.Count - 1; i++)
            {
                var lapTime = Lap.GetLapTimeUsingCarStates(reversedCarStates[i], reversedCarStates[i + 1]);
                TotalTime += lapTime;
            }
        }