Ejemplo 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));
        }
Ejemplo 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));
        }
Ejemplo n.º 3
0
 public Mood GetMentalCondition()
 {
     return(MoodFactory.GetMood(this.HappinessPoints));
 }
Ejemplo n.º 4
0
 public Engine()
 {
     this.foodFactory = new FoodFactory();
     this.moodFactory = new MoodFactory();
 }