Exemple #1
0
        public VanRange()
        {
            vans = new IVehicle[3];

            // Define the range of van models available
            vans[0] = new BoxVan(new StandardEngine(1600));
            vans[1] = new BoxVan(new StandardEngine(2000));
            vans[2] = new Pickup(new TurboEngine(2200));
        }
Exemple #2
0
        protected internal override IVehicle SelectVehicle(DrivingStyle style)
        {
            IVehicle selectedVehicle;

            if ((style == DrivingStyle.Economical) ||
                (style == DrivingStyle.Midrange))
            {
                selectedVehicle = new Pickup(new StandardEngine(2200));

            }
            else
            {
                selectedVehicle = new BoxVan(new TurboEngine(2500));
            }

            return selectedVehicle;
        }