コード例 #1
0
        static void Builder()
        {
            //the Meal Builder:
            MealBuilder mealBuilder = new MealBuilder();

            Meal vegMeal = mealBuilder.prepareVegMeal();

            Console.WriteLine("Veg Meal");
            vegMeal.showItems();
            Console.WriteLine("Total Cost: " + vegMeal.getCost());

            Meal nonVegMeal = mealBuilder.prepareNonVegMeal();

            Console.WriteLine("\n\nNon-Veg Meal");
            nonVegMeal.showItems();
            Console.WriteLine("Total Cost: " + nonVegMeal.getCost());

            //the Computer Bulder
            Computer comp = new ComputerBuilder("500 GB", "2 GB").setBluetoothEnabled(true).setGraphicsCardEnabled(true).build();
        }
コード例 #2
0
 public override void build(ComputerBuilder desktopBuilder)
 {
     desktopBuilder.BuildRam();
     desktopBuilder.BuildProcessor();
     desktopBuilder.BuildMousePad();
 }
コード例 #3
0
 public abstract void build(ComputerBuilder computerBuilder);