Beispiel #1
0
 void ExecuteTurn()
 {
     predator.ExecuteTurn();
     for (int i = preys.Count - 1; i >= 0; i--)
     {
         Prey prey = preys[i];
         if (prey != null)
         {
             prey.ExecuteTurn();
         }
         else
         {
             preys.RemoveAt(i);
         }
     }
     preysLeft = preys.Count;
     currentTurn++;
 }