Ejemplo n.º 1
0
        public string BepaalHabitat()
        {
            Console.WriteLine("Wordt het dier ondergebracht in ons Aquarium (1), het Safaripark(2), het Vogelparadijs(3) of de Kinderboerderij(4)?");
            bool test = false;

            do
            {
                if (int.TryParse(Console.ReadLine(), out int HabitatNum))
                {
                    if (Enum.IsDefined(typeof(Habitats), HabitatNum))
                    {
                        Habitats myHabitat = (Habitats)HabitatNum;
                        return(myHabitat.ToString());
                    }
                    else
                    {
                        Console.ForegroundColor = ConsoleColor.Red;
                        Console.WriteLine("--Dit is geen cijfer die overeenstemt met een habitat, probeer opnieuw.--");
                        Console.ResetColor();
                    }
                }
                else
                {
                    Console.ForegroundColor = ConsoleColor.Red;
                    Console.WriteLine("--Gelieve een cijfer in te geven.--");
                    Console.ResetColor();
                }
            } while (test == false);

            string helphoebenikhierditiszinloos = string.Empty;

            return(helphoebenikhierditiszinloos);
        }
Ejemplo n.º 2
0
 protected Animal(
     int legs,
     DermisProtrusions dermisProtrusion,
     IncubationTypes incubationType,
     Habitats habitat,
     BodyTypes bodyType,
     params Colors[] colors
     )
 {
     Legs             = legs;
     DermisProtrusion = dermisProtrusion;
     IncubationType   = incubationType;
     Habitat          = habitat;
     Colors           = colors;
 }
Ejemplo n.º 3
0
 public void SetHabitat(Habitats habitat)
 {
     Habitat = habitat;
 }
Ejemplo n.º 4
0
        public void AddHabitat(Habitat habitat)
        {
            Habitats.Add(habitat);

            TotalLivingSpace = Habitats.Sum(p => p.Size);
        }