Exemple #1
0
 public void Construct(VehicleBuilder vehicleBuilder)
 {
     vehicleBuilder.BuildFrame();
     vehicleBuilder.BuildEngine();
     vehicleBuilder.BuildWheels();
     vehicleBuilder.BuildDoors();
 }
        static void Main(string[] args)
        {
            var vehicleDealer = new VehicleDealer();

            //Construct and display vehicles
            _builder = new CarBuilder();
            vehicleDealer.Construct(_builder);
            _builder.Vehicle.Show();

            _builder = new MotoryckleBuilder();
            vehicleDealer.Construct(_builder);
            _builder.Vehicle.Show();

            _builder = new ScooterBuilder();
            vehicleDealer.Construct(_builder);
            _builder.Vehicle.Show();

            Console.ReadLine();
        }