Exemple #1
0
 public void removeDied(animal a)
 {
     if (a.IsDied == true)
     {
         animals.Remove(a);
         if (a.type == "bird")
         {
             birds.Remove(a as bird);
         }
         if (a.type == "mammal")
         {
             mammals.Remove(a as mammal);
         }
     }
 }
Exemple #2
0
 public void add(animal a)
 {
     if (a.age < 10)
     {
         animals.Add(a);
         if (a.type == "bird")
         {
             birds.Add(a as bird);
         }
         if (a.type == "mammal")
         {
             mammals.Add(a as mammal);
         }
     }
     a.animalZoo += removeDied;
 }