I have four flags
Current = 0x1 Past = 0x2 Future = 0x4 All = 0x7
Say I receive the two flags Past and Future (setFlags(PAST
setFlags(PAST
You may also want to add an extension method like this
enum states { Current = 0x1, Past = 0x2, Future = 0x4, All = 0x7 }; static bool Is(this states current, states value) { return (current & value) == value; }
then you can do:
if(state.Is(states.Past)) { // Past }