Beispiel #1
0
 public void Construct(VehicleBuilder vehicleBuilder)
 {
     vehicleBuilder.BuildFrame();
     vehicleBuilder.BuildEngine();
     vehicleBuilder.BuildWheels();
     vehicleBuilder.BuildDoors();
 }
 public void Construct(VehicleBuilder vehicleBuilder)
 {
     vehicleBuilder.BuildFrame();
     vehicleBuilder.BuildEngine();
     vehicleBuilder.BuildWheels();
     vehicleBuilder.BuildDoors();
 }
Beispiel #3
0
 public void Construct(VehicleBuilder vehicleBuilder)
 {
     vehicleBuilder.BuildShape();
     vehicleBuilder.BuildEngine();
     vehicleBuilder.BuildGearbox();
     vehicleBuilder.BuildWheels();
 }
 public void CreateVehicle(VehicleBuilder builder)
 {
     builder.BuildFrame();
     builder.BuildEngine();
     builder.BuildWheels();
     builder.BuildDoors();
 }
 // Builder uses a complex series of steps
 public static void Construct(VehicleBuilder vehicleBuilder)
 {
     //一か所にまとめておくことも可能。
     vehicleBuilder.BuildFrame();
     vehicleBuilder.BuildEngine();
     vehicleBuilder.BuildWheels();
     vehicleBuilder.BuildDoors();
 }
 //There may be different constructors (with different steps order)
 public void Construct(VehicleBuilder vehicleBuilder)
 {
     //класа директор определя последователността на стъпките при изграждането на колата.
     vehicleBuilder.BuildFrame();
     vehicleBuilder.BuildEngine();
     vehicleBuilder.BuildWheels();
     vehicleBuilder.BuildDoors();
 }
Beispiel #7
0
 public void Construct(VehicleBuilder vehicleBuilder)
 {
     // These are the steps required to build a vehicle
     vehicleBuilder.BuildFrame();
     vehicleBuilder.BuildEngine();
     vehicleBuilder.BuildWheels();
     vehicleBuilder.BuildDoors();
 }
        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();
        }