コード例 #1
0
ファイル: Program.cs プロジェクト: marsxn/college-programming
        static void Main(string[] args)
        {
            // Create director and builders
            Waiter waiter = new Waiter();

            PizzaBuilder b1 = new CheesePizzaBuilder();
            PizzaBuilder b2 = new MixedPizzaBuilder();

            // Construct two products
            waiter.Serve(b1);

            Pizza p1 = b1.GetPizza();
            p1.Deliver();

            waiter.Serve(b2);
            Pizza p2 = b2.GetPizza();
            p2.Deliver();

            // Wait for user
            Console.Read();
        }
コード例 #2
0
        static void Main(string[] args)
        {
            // Create director and builders
            Waiter waiter = new Waiter();

            PizzaBuilder b1 = new CheesePizzaBuilder();
            PizzaBuilder b2 = new MixedPizzaBuilder();

            // Construct two products
            waiter.Serve(b1);

            Pizza p1 = b1.GetPizza();

            p1.Deliver();

            waiter.Serve(b2);
            Pizza p2 = b2.GetPizza();

            p2.Deliver();

            // Wait for user
            Console.Read();
        }