Ejemplo n.º 1
0
 public override void Behavior()
 {
     base.Behavior();
     if (this.AnimalsAround.Count != 0)
     {
         for (int i = 0; i < AnimalsAround.Count(); i++)
         {
             if (AnimalsAround[i].Texture == AnimalTexture.Rabbit)
             {
                 ChangePosition(AnimalsAround[i].Position);
                 if (this.Area.IntersectsWith(AnimalsAround[i].Area))
                 {
                     AnimalsAround[i].Die();
                 }
             }
         }
     }
 }
Ejemplo n.º 2
0
 public override void Behavior()
 {
     base.Behavior();
     if (this.Hunger > 50)
     {
         if (this.AnimalsAround.Count != 0)
         {
             for (int i = 0; i < AnimalsAround.Count(); i++)
             {
                 if (TargetAnimals.Contains(AnimalsAround[i].Texture))
                 {
                     ChangePosition(AnimalsAround[i].Position);
                     if (this.Area.IntersectsWith(AnimalsAround[i].Area))
                     {
                         AnimalsAround[i].Die();
                         this.Hunger -= 50;
                     }
                 }
             }
         }
     }
 }