コード例 #1
0
        public void ParkVehicle(Vehicle vehicle)
        {
            garage.Add(vehicle);


            //int newindex= garage.Add(vehicle,indexnum);
            //indexnum = newindex;
        }
コード例 #2
0
ファイル: Handler.cs プロジェクト: MohamedHlabba/Garage1.0
        private void AddCar()

        {
            string regst = Extensions.AskForString("Registernummer", ui);
            bool   has1  = garage.Any(ve => ve.RegisterNummer.EqualsInsensitive(regst));

            if (has1)
            {
                ui.Print("vehicule exists already with that registernumber");
                return;
            }

            string brandc   = Extensions.AskForString("Brand", ui);
            string colorc   = Extensions.AskForString("Color", ui);
            int    wheelsc  = Extensions.AskForInt("Wheels", ui);
            string fueltype = Extensions.AskForString("FuelType", ui);
            var    car      = new Car(regst, brandc, colorc, wheelsc, fueltype);

            garage.Add(car);
            ui.Print("You add a new Car");
        }
コード例 #3
0
 public void ParkVehicle(Vehicle vehicle)
 {
     garage.Add(vehicle);
 }
コード例 #4
0
        public bool ParkIn(Vehicle vehicle)

        {
            return(garage.Add(vehicle));
        }