Exemple #1
0
        public void SetSpeed(decimal amount, string unitsString)
        {
            SpeedUnits speedUnits = SpeedUnits.MetersPerSecond;

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

            _car.SetSpeed(new Speed(amount, speedUnits));
        }