示例#1
0
        static void Main(string[] args)
        {
            Director director = new Director(new DellBuilder());

            director.BuildBasicKit();
            Console.WriteLine($"Dell basic kit:\n{director.GetProduct().GetParts()}");
            director.BuildStandardKit();
            Console.WriteLine($"Dell standard kit:\n{director.GetProduct().GetParts()}");
            director.BuildStandardPlusKit();
            Console.WriteLine($"Dell standard plus kit:\n{director.GetProduct().GetParts()}");
            director.BuildLuxKit();
            Console.WriteLine($"Dell lux kit:\n{director.GetProduct().GetParts()}");

            Console.WriteLine();

            director = new Director(new SonyBuilder());

            director.BuildBasicKit();
            Console.WriteLine($"Sony basic kit:\n{director.GetProduct().GetParts()}");
            director.BuildStandardKit();
            Console.WriteLine($"Sony standard kit:\n{director.GetProduct().GetParts()}");
            director.BuildStandardPlusKit();
            Console.WriteLine($"Sony standard plus kit:\n{director.GetProduct().GetParts()}");
            director.BuildLuxKit();
            Console.WriteLine($"Sony lux kit:\n{director.GetProduct().GetParts()}");

            Console.ReadLine();
        }