public void SetSpeed(decimal amount, string unitsString) { SpeedUnits speedUnits = SpeedUnits.MetersPerSecond; if (unitsString == "cps") { speedUnits = SpeedUnits.CentimetersPerSecond; } thisCar.SetSpeed(new Speed(amount, speedUnits)); }
public void SetSpeed(decimal amount, string unitsString) { SpeedUnits speedUnits = ChooseSpeedUnits(unitsString); _car.SetSpeed(new Speed(amount, speedUnits)); }