示例#1
0
 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);
     }
 }
示例#2
0
 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);
     }
 }
示例#3
0
 /// <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);
 }
示例#4
0
 public override void EatFood(Food f)
 {
     this.FoodEaten += f.QTY;
 }
示例#5
0
 public abstract void EatFood(Food f);