コード例 #1
0
        static void Main()
        {
            FoodFactory foodFactory = new FoodFactory();
            MoodFactory moodFactory = new MoodFactory();

            Console.ReadLine().Split(new [] { " " }, StringSplitOptions.RemoveEmptyEntries)
            .ToList()
            .ForEach(x => foods.Add(foodFactory.CreateInstace(x.ToLower())));
            int  totalPoints = foods.Select(x => x.Points).Sum();
            Mood mood        = moodFactory.CreateInstance(totalPoints);

            Console.WriteLine(mood.ToString());
        }