Esempio n. 1
0
        private static void checkCarDoors(string i_CarDoorsStringFormat, ref Car.CarDoors io_CarDoors)
        {
            if (i_CarDoorsStringFormat != "1" && i_CarDoorsStringFormat != "2" &&
                i_CarDoorsStringFormat != "3" && i_CarDoorsStringFormat != "4")
            {
                throw new FormatException("Bad Input Chose one Number From (1-4)");
            }

            io_CarDoors = (Car.CarDoors)(int.Parse(i_CarDoorsStringFormat) + 1);
        }
Esempio n. 2
0
        private static Car.CarDoors getCarDoors()
        {
            Car.CarDoors carDoors = 0;
            carDoorsLabel();
            carDoorsInstructionMessage();
            carDoorInputMessage();
            string carDoorsStringFormat = Console.ReadLine();

            try
            {
                checkCarDoors(carDoorsStringFormat, ref carDoors);
            }
            catch (FormatException ex)
            {
                Console.WriteLine(ex.Message);
                carDoors = getCarDoors();
            }

            return(carDoors);
        }
 public static Vehicle CreateNewCar(
     ref Client i_Owner,
     Vehicle.VehicleType i_Type,
     string i_ModelName,
     string i_LicenseNumber,
     ref EnergySystem i_EnergySystem,
     short i_WheelsNumber,
     ref List <Wheel> i_Wheels,
     Car.CarColor i_CarColor,
     Car.CarDoors i_DoorsNumber)
 {
     return(new Car(
                ref i_Owner,
                i_Type,
                i_ModelName,
                i_LicenseNumber,
                ref i_EnergySystem,
                i_WheelsNumber,
                ref i_Wheels,
                i_CarColor,
                i_DoorsNumber));
 }