Example #1
0
File: Zoo.cs Project: L-Henry/FiSo
        public void ProduceerGeluid()
        {
            foreach (Dier dier in _dieren)
            {
                dier.MaakGeluid();

                if (dier is Vogel)
                {
                    Vogel gecasteVogel = dier as Vogel;
                    gecasteVogel.Vlieg();
                }
                else if (dier is Vis)
                {
                    Vis gecasteVis = dier as Vis;
                    gecasteVis.Zwem();
                }
                else if (dier is Reptiel)
                {
                    Reptiel gecasteKrokodil = dier as Reptiel;
                    gecasteKrokodil.Kruip();
                }
                else if (dier is Zoogdier)
                {
                    Zoogdier gecasteZoogdier = (Zoogdier)dier;
                    gecasteZoogdier.Stap();
                }
            }
        }
Example #2
0
File: Zoo.cs Project: L-Henry/FiSo
 public void LaatAlleVogelsVliegen()
 {
     foreach (Dier dier in _dieren)
     {
         if (dier is Vogel)
         {
             Vogel gecasteVogel = dier as Vogel;
             gecasteVogel.Vlieg();
         }
     }
 }