public SetupProperty(string name, LocationOnVehicle locationOnVehicle, SetupPropertyCategory setupPropertyCategory, int minValue, int maxValue, bool isMaxToOversteer) { Name = name; LocationOnVehicle = locationOnVehicle; SetupPropertyCategory = setupPropertyCategory; MinValue = minValue; MaxValue = maxValue; IsMaxToOverSteer = isMaxToOversteer; }
private void AddArrayToProperties(PropertyInfo prop, List <double> list) { var fourPos = new LocationOnVehicle[] { LocationOnVehicle.LEFT_FRONT, LocationOnVehicle.RIGHT_FRONT, LocationOnVehicle.LEFT_REAR, LocationOnVehicle.RIGHT_REAR }; var twoPos = new LocationOnVehicle[] { LocationOnVehicle.FRONT, LocationOnVehicle.REAR }; if (list.Count == 4) { for (var i = 0; i < list.Count; i++) { _updatableSetupProperties.Add(new UpdatableSetupProperty { Name = $"{prop.Name}", Value = Convert.ToDouble(list[i]), LocationOnVehicle = fourPos[i] }); } } if (list.Count == 2) { for (var i = 0; i < list.Count; i++) { _updatableSetupProperties.Add(new UpdatableSetupProperty { Name = $"{prop.Name}", Value = Convert.ToDouble(list[i]), LocationOnVehicle = twoPos[i] }); } } }