예제 #1
0
 public override void Reproduce(Coordinate initCoord)
 {
     Ocean1.NumBornPredators += 1;
     TimeToReproduce          = InitTimeToReproduce;
     Ocean1[initCoord]        = new Predator(initCoord);
     Ocean1.NumPredators     += 1;
 }
예제 #2
0
 private void AddPredators()
 {
     for (int i = 0; i < NumPredators; i++)
     {
         while (true)
         {
             byte x = (byte)_random.Next(0, NumCols);
             byte y = (byte)_random.Next(0, NumRows);
             if (_cells[x, y] == null)
             {
                 _cells[x, y] = new Predator(new Coordinate(x, y));
             }
             else
             {
                 continue;
             }
             break;
         }
     }
 }