Original Post
ChooseEnum displays all the elements in a enum and asks the user to choose one (by an associated value which is displayed) Is there any way make the following look nicer? (remove the cast and typeof) Also is there any way to create enums on the fly? e.g. load the haircolours from a file. If not I'll need to use some sort of associative container (like maps in c++), should I use Dictionaries? or can people suggest a better alternative? Using dictionaries would make the above code look neater , But I would lose type safety. Hope that makes sense.
static int ChooseEnum(Type enumerable)
HairColour playerHairColour = (HairColour) ChooseEnum(typeof(HairColour));