Exemplo n.º 1
0
 private void EatPreysAt(ICell<Coordinates2D, EmptyData, EmptyData> target)
 {
     double preyWeight = 0;
     foreach(PreyAnt preyAnt in target.OfType<PreyAnt>()) {
         preyWeight += preyAnt.Weight;
         this.Kill(preyAnt);
     }
     Weight = (int) Math.Min(6, preyWeight * MassPrey + Weight);
     this.MoveTo(target.Coordinate);
 }