public static void Main() { var threeWheelRedCar = CarMaker.BuildCar(new ThreeWheelsRedCar()); var fourWheelBlackCar = CarMaker.BuildCar(new FourWheelsBlackCar()); threeWheelRedCar.display(); fourWheelBlackCar.display(); }
private static void BuildAudiCar() { Console.WriteLine("-> Start Audi car builder <-"); var carMaker2 = new CarMaker(new AudiCarBuilder()); carMaker2.BuildCar(); var car2 = carMaker2.GetCar(); car2.Display(); Console.WriteLine("-> End Audi car builder <-"); Console.WriteLine(); }
private static void BuildVolkswagenCar() { Console.WriteLine("-> Start Volkswagen car builder <-"); var carMaker3 = new CarMaker(new VolkswagenCarBuilder()); carMaker3.BuildCar(); var car3 = carMaker3.GetCar(); car3.Display(); Console.WriteLine("-> Start Volkswagen car builder <-"); Console.WriteLine(); }
private static void BuildBmwCar() { Console.WriteLine("-> Start BMW car builder <-"); var carMaker = new CarMaker(new BmwCarBuilder()); carMaker.BuildCar(); var car1 = carMaker.GetCar(); car1.Display(); Console.WriteLine("-> End BMW car builder <-"); Console.WriteLine(); }
private static void callBuilderPattern() { CarMaker carMaker = new CarMaker(new FordBuilder()); carMaker.BuildCar(); var car1 = carMaker.GetCar(); car1.PrintCar(); CarMaker carMaker2 = new CarMaker(new HundaiBuilder()); carMaker2.BuildCar(); var car2 = carMaker2.GetCar(); car2.PrintCar(); }