public override IVehicle Build(VehicleBuilder builder) { builder.BuildChassis(); builder.BuildBody(); builder.BuildReinforcedStorageArea(); builder.BuildWindows(); return(builder.Vehicle); }
public override IVehicle Build(VehicleBuilder builder) { builder.BuildChassis(); builder.BuildBody(); builder.BuildPassengerArea(); builder.BuildBoot(); builder.BuildWindows(); return(builder.Vehicle); }
//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; }
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(); }