예제 #1
0
 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);
     }
 }
예제 #2
0
 public void AddTrip(DrivingRecord record)
 {
     Time  += record.Time;
     Miles += record.Miles;
 }