示例#1
0
        public override Car Construct()
        {
            CarBuilder.BuildFrame();
            CarBuilder.BuildEngine();
            CarBuilder.BuildWheels();
            CarBuilder.BuildSafety();

            return(CarBuilder.GetCar());
        }
 public void When_Car_IsBuild()
 {
     var builder = new CarBuilder();
     builder
         .BuildFrame()
         .BuildEngine()
         .BuildWheels()
         .BuildDoors()
         .DisplayVehicle();
 }
示例#3
0
        static void Main(string[] args)
        {
            CarBuilder carBuilder = new CarBuilder(new BMW520Car());

            carBuilder.BuildFrame();
            carBuilder.BuildEngine();
            carBuilder.BuildDoors();
            carBuilder.BuildWheels();
            carBuilder.Show();
        }