Esempio n. 1
0
 public override IVehicle Build(VehicleBuilder builder)
 {
     builder.BuildChassis();
     builder.BuildBody();
     builder.BuildReinforcedStorageArea();
     builder.BuildWindows();
     return(builder.Vehicle);
 }
Esempio n. 2
0
 public override IVehicle Build(VehicleBuilder builder)
 {
     builder.BuildChassis();
     builder.BuildBody();
     builder.BuildPassengerArea();
     builder.BuildBoot();
     builder.BuildWindows();
     return(builder.Vehicle);
 }
Esempio n. 3
0
 //the director determines the order in which th steps are to be executed
 //being executed by the builder
 public override IVehicle Build(VehicleBuilder builder)
 {
     builder.BuildChassis();
     builder.BuildBody();
     builder.BuildPassengerArea();
     builder.BuildBoot();
     builder.BuildWindows();
     return builder.Vehicle;
 }
Esempio n. 4
0
        static void Main(string[] args)
        {
            AbstractVehicleFactory sportVehicle  = new SportVehicleFactory();
            AbstractVehicleFactory cofortVehicle = new ComfortVehicleFactory();

            VehicleBuilder builder = new VehicleBuilder();

            builder.BuildBody(cofortVehicle);
            builder.BuildEngine(sportVehicle);
            builder.BuildTransmition(sportVehicle);

            Vehicle hybridVehicle = builder.Vehicle;

            Console.WriteLine(hybridVehicle);

            Console.ReadKey();
        }