I have an Option set that I use to efficiently store various information about an object. I.e. the first 6 or so bits determine the "type", and several bits determine whether or not it is in certain states, which may or may not be mutually exclusive.
I had this all as one big option set. I know one implementation option for me would be to go back and rework it into separate enumerations. Alas, that would be a lot more difficult, and I really liked the one int that needed to be stored to hold all of this information.
Currently, I'm unable to use a switch case, because the value rarely matches a single option. I want to be able to do a switch case on the type part, and a separate switch case on the state parts. But, the only implementation I could find was some ugly if / else chains.
Is there some other operation I may be missing that can accomplish this better?