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); }
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; }
public void SetHabitat(Habitats habitat) { Habitat = habitat; }
public void AddHabitat(Habitat habitat) { Habitats.Add(habitat); TotalLivingSpace = Habitats.Sum(p => p.Size); }