public override void EatFood(Food f) { if (f.Type != "Vegetable") { //Console.WriteLine("Zebras are not eating that type of food!"); AnimalCannotEat(); } else { base.EatFood(f); } }
public override void EatFood(Food f) { if (f.Type != "Vegetable") { //Console.WriteLine("Mouses are not eating that type of food! "); AnimalCannotEat(); } else { Console.WriteLine("A cheese was just eaten!"); base.EatFood(f); } }
/// <summary> /// If the Snake collides with food, the food should dissapear and the Snake should /// grow by one unit. /// </summary> /// <param name=""></param> /// <returns></returns> public bool CollidesWithFood(Food.Food food) { return(false); }
public override void EatFood(Food f) { this.FoodEaten += f.QTY; }
public abstract void EatFood(Food f);