I have the following C# code:
AnimalTypeEnum animal;
string s = Console.ReadLine();
switch (s.ToLower())
{
case \"dog\":
animal = AnimalTypeEnum.DOG;
You should have a default ENUM
for any animal unknown to your code. You could even make your code to learn new animals. For instance.
switch (s.ToLower())
{
default:
animal = AnimalType.Unkown;
break;
}
or
default:
animal = new MakeEnum(s.ToLower());
myEnumList.Add(animal);
break;
Your MakeEnum
basically just needs to check length of current number of enums, and make a new enum using the number or some other parameter.