public void OverrideWith(DataSourceProperties overridingProperties) { if (overridingProperties == null) { return; } SourceName = overridingProperties.SourceName; TyreCompoundsProperties.RemoveAll(x => overridingProperties.TyreCompoundsProperties.Any(f => f.CompoundName == x.CompoundName)); TyreCompoundsProperties.AddRange(overridingProperties.TyreCompoundsProperties); CarModelsProperties.RemoveAll(x => overridingProperties.CarModelsProperties.Any(f => f.Name == x.Name)); CarModelsProperties.AddRange(overridingProperties.CarModelsProperties); }
public void MigrateUp() { if (!ContainsRearTyres) { foreach (var tyreCompound in TyreCompoundsProperties.Concat(CarModelsProperties.SelectMany(x => x.TyreCompoundsProperties))) { tyreCompound.RearIdealPressure = Pressure.FromKiloPascals(tyreCompound.FrontIdealPressure.InKpa); tyreCompound.RearIdealPressureWindow = Pressure.FromKiloPascals(tyreCompound.FrontIdealPressureWindow.InKpa); if (tyreCompound.FrontIdealTemperature == null) { continue; } tyreCompound.RearIdealTemperature = Temperature.FromCelsius(tyreCompound.FrontIdealTemperature.InCelsius); tyreCompound.RearIdealTemperatureWindow = Temperature.FromCelsius(tyreCompound.FrontIdealTemperatureWindow.InCelsius); } ContainsRearTyres = true; } }
public void AddTyreCompound(TyreCompoundProperties newCompound) { TyreCompoundsProperties.Add(newCompound); }
public TyreCompoundProperties GetTyreCompound(string compoundName) { return(TyreCompoundsProperties.FirstOrDefault(x => x.CompoundName == compoundName)); }