Esempio n. 1
0
 public void     PredatorDay(Predator ani)
 {
     GoHunt(ani);
     Mate(ani);
     ani.Energy -= 20;
     if (ani.Energy <= 0)
     {
         ani.IsAlive = false;
     }
 }
Esempio n. 2
0
 public void     GoHunt(Predator Hunter)
 {
     if (Hunter.Energy > 20)
     {
         Prey Victime = FindPrey();
         if (Victime != null)
         {
             Hunt(Hunter, Victime);
         }
     }
 }
Esempio n. 3
0
 public override Predator DoubleReproduce(Predator b)
 {
     if (Utils.ChanceSucces(this.ReproductionChance * 2))
     {
         Lion cast = (Lion)b;
         return(new Lion(Utils.RandomSex(), cast.HuntSuccesChance / 2 + this.HuntSuccesChance / 2));
     }
     else
     {
         return(null);
     }
 }
Esempio n. 4
0
 public void     Hunt(Predator Hunter, Prey Victime)
 {
     if (IsHuntSucces(Hunter, Victime))
     {
         Victime.IsAlive = false;
         Hunter.Feed();
     }
     else
     {
         Hunter.Energy  -= 20;
         Victime.Energy -= 20;
     }
 }
Esempio n. 5
0
 public abstract Predator DoubleReproduce(Predator b);
Esempio n. 6
0
 public bool     IsHuntSucces(Predator Hunter, Prey Victime)
 {
     return(Utils.ChanceSucces(Victime.EscapeChance * (1 - Hunter.HuntSuccesChance)));
 }