Exemple #1
0
        static void Main(string[] args)
        {
            VehicleBuilder builder;

            var shop = new Shop();

            builder = new ScooterBuilder();
            shop.Construct(builder);
            builder.GetVehicle().Show();

            builder = new CarBuilder();
            shop.Construct(builder);
            builder.GetVehicle().Show();

            builder = new MotorCycleBuilder();
            shop.Construct(builder);
            builder.GetVehicle().Show();
        }
Exemple #2
0
        static void Main(string[] args)
        {
            VehicleBuilder builder;

            // Create shop with vehicle builders
            Shop shop = new Shop();

            // Construct and display vehicles
            builder = new ScooterBuilder();
            shop.Construct(builder);
            builder.GetVehicle().Show();

            builder = new CarBuilder();
            shop.Construct(builder);
            builder.GetVehicle().Show();

            builder = new MotorCycleBuilder();
            shop.Construct(builder);
            builder.GetVehicle().Show();

            // Wait for user
            Console.ReadKey();
        }