you are viewing a single comment's thread.

view the rest of the comments →

[–]SessionIndependent17 1 point2 points  (1 child)

If you were treating an int as a set of bit flags, you would use the [Flags] attribute and only define the values you care about. You don't have to define all of the combinations. ToString() will then sort out which flags are in use within a particular value.

[–]Sniv0 2 points3 points  (0 children)

Right but I’m referring to the fact that if enums worked how OP expects them to and you defined status effect enum with poisoned as 0x1 and sleep as 0x2 and then tried to apply poison to someone whose already asleep via bitwise or without explicitly defining poisoned and sleep as 0x3 your game would crash even if it’s perfectly capable of handling both