Exemplo n.º 1
0
 public override void Consume(IConsumable item)
 {
     if (isFull)
     {
         System.Console.WriteLine("SweetTooth is full and cannot consume anymore.");
     }
     else
     {
         if (caloriesIntake < 1500)
         {
             if (item.IsSweet)
             {
                 caloriesIntake += (item.Calories + 10);
             }
             else
             {
                 caloriesIntake += item.Calories;
             }
             FoodHistory.Add(item);
             item.GetInfo();
         }
         else
         {
             isFull = true;
         }
     }
 }
Exemplo n.º 2
0
        public override void Consume(IConsumable item)
        {
            // provide override for Consume
            if (IsFull)
            {
                Console.WriteLine("Too full, won't do it.");
                return;
            }
            int newCalories = (item.IsSpicy) ? item.Calories - 5 : item.Calories;

            calorieIntake += newCalories;
            FoodHistory.Add(item);
            item.GetInfo();
        }
Exemplo n.º 3
0
 public override void Eat(IConsumable item)
 {
     if (IsFull() == true)
     {
         Console.WriteLine("Your Ninja is a fatty and can't eat anymore!");
     }
     else
     {
         calorieIntake += item.Calories;
         if (item.IsSweet == true)
         {
             calorieIntake += 10;
         }
         FoodHistory.Add(item);
         Console.WriteLine(item.GetInfo());
     }
 }
Exemplo n.º 4
0
        public override void Consume(IConsumable Item)
        {
            if (IsFull)
            {
                Console.WriteLine("Can't take another bite...");
                return;
            }

            Console.WriteLine($"SweetTooth is hungry and consumes a tasty {Item.Name}");
            if (Item.IsSweet == true)
            {
                calorieIntake += 10;
            }
            calorieIntake += Item.Calories;
            FoodHistory.Add(Item);
            Console.WriteLine(Item.getInfo());
        }
Exemplo n.º 5
0
 public override void Consume(IConsumable item)
 {
     if (IsFull == false)
     {
         if (item.IsSweet)
         {
             calorieIntake += 10;
         }
         calorieIntake += item.Calories;
         FoodHistory.Add(item);
         item.GetInfo();
     }
     else
     {
         Console.WriteLine("SweetTooth is full and can't eat another bite!");
     }
 }
Exemplo n.º 6
0
 public override void Consume(IConsumable item)
 {
     if (IsFull == false)
     {
         if (item.IsSpicy)
         {
             calorieIntake -= 5;
         }
         calorieIntake += item.Calories;
         FoodHistory.Add(item);
         item.GetInfo();
     }
     else
     {
         Console.WriteLine("The SpiceHound is full and can't eat another bite!");
     }
 }
Exemplo n.º 7
0
        public override void Eat(IConsumable item)
        {
            string output;

            if (!this.IsFull())
            {
                output          = $"Sweet tooth ate {item.GetInfo()}";
                _calorieIntake += item.Calories;
                if (item.IsSweet)
                {
                    _calorieIntake += 10;
                }
                FoodHistory.Add(item);
            }
            else
            {
                output = "Sweet tooth is too full to eat!";
            }
            Console.WriteLine(output);
        }