Ejemplo n.º 1
0
        private static void ProcessCommand(Vehicle vehicle, string action, double parameter)
        {
            if (action == "Drive")
            {
                vehicle.Drive(parameter);
            }
            else if (action == "Refuel")
            {
                vehicle.Refueling(parameter);
            }
            else if (action == "DriveEmpty")
            {
                ((Bus)vehicle).TurnOffAirConditioner();

                vehicle.Drive(parameter);

                ((Bus)vehicle).TurnOnAirConditioner();
            }
        }