Esempio n. 1
0
        static void Main(string[] args)
        {
            int happyPoints = 0;

            string[] tokens = Console.ReadLine().Split();
            foreach (var food in tokens)
            {
                Food currFood = Factory.GetInputFood(food);
                happyPoints += currFood.FoodValue;
            }
            Console.WriteLine(happyPoints);
            Console.WriteLine(MoodFactory.GetGandalfMood(happyPoints));
        }
Esempio n. 2
0
        public static void Main(string[] args)
        {
            var foodTokens = Console.ReadLine()
                             .Split(new char[] { '\t', ' ', '\n' }, StringSplitOptions.RemoveEmptyEntries);

            var foods      = new List <Food>();
            var moodFactor = 0;

            foreach (var item in foodTokens)
            {
                foods.Add(FoodFactory.MakeFood(item));
            }

            foreach (var food in foods)
            {
                moodFactor += food.GetHappinessPoints();
            }

            Console.WriteLine(moodFactor);
            Console.WriteLine(MoodFactory.GetCorrespondingMood(moodFactor));
        }
Esempio n. 3
0
 public Mood GetMentalCondition()
 {
     return(MoodFactory.GetMood(this.HappinessPoints));
 }
Esempio n. 4
0
 public Engine()
 {
     this.foodFactory = new FoodFactory();
     this.moodFactory = new MoodFactory();
 }