private static DriverTraceData BuildTraceForDriver(DriverRaceData driverRaceData, ReferenceTime referenceTime, string team) { var lapData = driverRaceData.GetAllLaps().Select(x => x.Time.TimeTaken); var traceTimes = CalculateCumulativeTimes(referenceTime, lapData); return(BuildTraceData(driverRaceData, traceTimes, team)); }
private static DriverTraceData BuildTraceData(DriverRaceData driverRaceData, TimeSpan[] traceTimes, string team) { var traceData = new DriverTraceData(driverRaceData.DriverCode, team); for (var lapIndex = 0; lapIndex < traceTimes.Count(); lapIndex++) { traceData.AddLap(new LapCount(lapIndex + 1), new TimeDelta(traceTimes[lapIndex])); } return(traceData); }