I’m thinking that isn’t such a great idea now, for the primary reason that it makes updates very hard to do, say if you want to add two more affects you not only need to add the fields to the code, but you have to modify the database. My goal is to make it so that you don’t have to modify any datafiles when you add/remove minor details.
An advantage of using an XML File is that the XML Serializer will take care of all the details, so if an element is missing then it will be filled in with the default value. I don’t yet know how it will handle an Enum member missing or a field missing.
I just did some testing and there are no problems if an element in the XML document exists that doesn’t match up with an appropriate property in the class.
There is a problem if you remove or rename a member in an enum that is present within the XML document, because the member is referenced by name.
C# does allow you to have two members in an enum share the same value, but there is a slight problem with just adding your new member in addition to the older one. You have no idea which of the two values was used to set the flag. So you wind up with another unworkable solution.
There is a faint light at the end of the tunnel, because the XML Serializer reacts well to new data members being added to a class you can add a new set of flags. The downside of course is that you need to add code to use that set of flags, but you had to modify those bits of code anyway.