コード例 #1
0
        private static DiningSet AssembleSet(DefaultFactory factory)
        {
            List <Chair> chairs = new List <Chair>();

            for (int i = 0; i < 4; i++)
            {
                chairs.Add(factory.MakeChair());
            }

            return(new DiningSet()
            {
                Table = factory.MakeTable(),
                Chairs = chairs
            });
        }