public void AddDataPoint(int driverNumber, int lapNumber, float speed, float rpm) { AnalysisDriver driver = GetDriver(driverNumber); AnalysisLap lap = driver.GetLap(lapNumber); lap.AddData(speed, rpm); }
private AnalysisDriver GetDriver(int driverNumber) { AnalysisDriver driver = _drivers.Find(d => d.Id == driverNumber); if (driver == null) { driver = new AnalysisDriver() { Id = driverNumber }; _drivers.Add(driver); } return(driver); }