public void ProcessRecord(DrivingRecord record) { if (record.IsRegistration) { _records.Add(record.Name, record); } else if (_records.TryGetValue(record.Name, out DrivingRecord existing)) { existing.AddTrip(record); } }
public void AddTrip(DrivingRecord record) { Time += record.Time; Miles += record.Miles; }