示例#1
0
        internal static void InsertVehicle(Garage i_Garage)
        {
            List <Type> vehicleTypes = Garage.GetVehicleTypes();

            Console.Write(Messages.ChooseVehicleType(vehicleTypes));
            Type vehicleType = vehicleTypes[Utils.GetValidInRangeFromUser(1, vehicleTypes.Count) - 1];
            Dictionary <string, Type>   emptyVehicleConfigurations      = i_Garage.GetEmptyDictionary(vehicleType);
            Dictionary <string, Type>   prettyEmptyVehicleConfiguration = Utils.PrettyEmptyDictionary(emptyVehicleConfigurations);
            Dictionary <string, object> vehicleConfigurations           = Utils.GetConfigurationByDictionary(prettyEmptyVehicleConfiguration, i_Garage, vehicleType);

            if (!i_Garage.InsertVehicle(vehicleType, vehicleConfigurations))
            {
                Console.WriteLine(Messages.sr_VehicleAllreadyExist);
            }
        }