public override void Eat(Food food) { if (food.GetType().Name == "Meat") { this.FoodEaten += food.Quantity; } else { Console.WriteLine($"{this.GetType().Name}s are not eating that type of food!"); } }
public override void Eat(Food food) { if (food.GetType().Name == "Vegetable") { this.FoodEaten += food.Quantity; Console.WriteLine("A cheese was just eaten!"); } else { Console.WriteLine($"{this.GetType().Name}s are not eating that type of food!"); } }
public override void Eat(Food food) { this.FoodEaten += food.Quantity; }
public abstract void Eat(Food food);