How to edit the Values of an Enum that are a Library

I’m trying to make a library in C# for creating roleplaying games (RPGs from here on out) in the console with graphics generated by a few classes I’m coding. I’d like to make it so that when using the library, one creates a number of rooms, as with typical RPGs. I have a public enum I’ve entitled Rooms for this purpose. The issue is that Rooms won’t be editable by the user, as it will be part of the library and not their Program.cs, which should be all they need to make their RPG function with proper graphics (which requires Rooms to have certain values). However, they’ll need to choose what rooms they want in their game, so this doesn’t work.

How can I get around this? I was hoping that perhaps one could generate the values of an enum using either an XML file (perhaps you would run a program once to take the values in the XML file and plop them into the Rooms enum, and then begin coding your RPG), a dictionary, or an array, but I’m not sure it’s possible.

How can I go about doing this in a way that will be convenient for the maker of the RPG (to reiterate, the objective is to make it possible for the coder to edit only the Program.cs file)? And would it make more sense to offer this RPG kit as a Visual Studio solution so that the coder can just edit everything him/herself?


Source: dll

Leave a Reply