Exemplo n.º 1
0
        static void Main()
        {
            var inputLine = Console.ReadLine()
                            .Split(new[] { ' ', '\t', '\n' }, StringSplitOptions.RemoveEmptyEntries);

            var mood = 0;

            foreach (var food in inputLine)
            {
                mood += FoodFactory.MakeFood(food).GetPoints();
            }

            Console.WriteLine(mood);
            Console.WriteLine(MoodFactory.GetMood(mood).GetMood());
        }
Exemplo n.º 2
0
        public static void Main()
        {
            string[]    foodArgs = Console.ReadLine().Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
            List <Food> foods    = new List <Food>();

            foreach (string food in foodArgs)
            {
                Food currentFood = FoodFactory.GenerateFood(food);
                foods.Add(currentFood);
            }

            Mood mood = MoodFactory.GenerateMood(foods);

            Console.WriteLine(foods.Sum(f => f.PointsOfHappines));
            Console.WriteLine(mood);
        }
Exemplo n.º 3
0
        public static void Main()
        {
            var gandalf = new Gandalf();

            var inputFood = Console.ReadLine().Split(new[] { '\t', ' ', '\n' }, StringSplitOptions.RemoveEmptyEntries);

            foreach (var foodStr in inputFood)
            {
                Food food = FoodFactory.MakeFood(foodStr);
                gandalf.Eat(food);
            }

            int  totalHapinessPoints = gandalf.GetHapinessPoints();
            Mood currentMood         = MoodFactory.GetCorrespondingMood(totalHapinessPoints);

            Console.WriteLine(totalHapinessPoints);
            Console.WriteLine(currentMood);
        }
Exemplo n.º 4
0
 public void SetMood()
 {
     mood = MoodFactory.GetMood(pointsOfHappines);
 }
Exemplo n.º 5
0
 public Mood GetHappineess()
 {
     return(MoodFactory.GetMood(this.happinessPoints));
 }