コード例 #1
0
ファイル: StartUp.cs プロジェクト: Ivolekov/SoftUni_3.0
        static void Main(string[] args)
        {
            string[] input = Console.ReadLine().Split(new char[] {},
                                                      StringSplitOptions.RemoveEmptyEntries);
            List <Food> foods      = new List <Food>();
            int         moodFactor = 0;

            foreach (var food in input)
            {
                moodFactor += FoodFactory.MakeFood(food).GetHappinessPoints();
                foods.Add(FoodFactory.MakeFood(food));
            }

            Console.WriteLine(moodFactor);
            Console.WriteLine(MoodFactory.MakeMood(moodFactor).GetMood());
        }
コード例 #2
0
 public void CalculateMood()
 {
     this.Mood = MoodFactory.ProduceMood(this.TotalHappinessPoints);
 }