OptionNames Class Reference

This class has no intrinsic functionality, it simply stores two arrays of names.
It is up to user of this class to serialize/deserialize the string lists as desired. Usage by its CustomPropertyDrawer class uses the following protocol: FullList contains all the names available for selection, while SelectedOptionNames contains a subset of fullList, specifying which of those options are enabled/selected. The custom property drawer allows the user access to these options as a generic looking "mask field" control. The advantage to using string lists like this over integer masks for attributes is that; the attributes used may change (existence and order) as the programmer works on the system. This can wreak havoc when deserializing saved objects that use bit-fields. The second advantage is that the "fullList" can be changed at runtime, unlike enums.

Public Member Functions

List< string > SelectedOptionsThatAreNotInFullList ()
 Checks the selectedOptionNames array against the fullList array to confirm that all strings in the selected list are in fact in the full list.
 

Public Attributes

string[] fullList
 List of all names that are available for selection. This list may be grown by the user at anytime, but any selected options should not be removed.
 
string[] selectedOptionNames
 Subset of fullList. Contains all the names that are "selected". Should only contain names that are included in fullList. The SelectedOptionsThatAreNotInFullList function can be used to confirm validity.