Ejemplo n.º 1
0
 public void     PreyDay(Prey ani)
 {
     ani.Feed();
     Mate(ani);
     ani.Energy -= 20;
     if (ani.Energy <= 0)
     {
         ani.IsAlive = false;
     }
 }
Ejemplo n.º 2
0
 public void     GoHunt(Predator Hunter)
 {
     if (Hunter.Energy > 20)
     {
         Prey Victime = FindPrey();
         if (Victime != null)
         {
             Hunt(Hunter, Victime);
         }
     }
 }
Ejemplo n.º 3
0
 public void     Hunt(Predator Hunter, Prey Victime)
 {
     if (IsHuntSucces(Hunter, Victime))
     {
         Victime.IsAlive = false;
         Hunter.Feed();
     }
     else
     {
         Hunter.Energy  -= 20;
         Victime.Energy -= 20;
     }
 }
Ejemplo n.º 4
0
 public bool     IsHuntSucces(Predator Hunter, Prey Victime)
 {
     return(Utils.ChanceSucces(Victime.EscapeChance * (1 - Hunter.HuntSuccesChance)));
 }