Data with enums
I want to add some data with enums, but you can't do much more than bytes or ints in C#. To go around this, I've done this instead:
8 Replies
This just seems wrong. Is there a better way to do it?
I'm a bit unsure on what you're asking
Seems they are trying to do rich enums. There are packages let you do something similar to this. Lemme see if I can find it ..
GitHub
GitHub - ardalis/SmartEnum: A base class for quickly and easily cre...
A base class for quickly and easily creating strongly typed enum replacements in C#. - ardalis/SmartEnum
Do you need the dictionary there? The normal pattern is just:
I did it the way I did it so that I could recycle the same instance instead of creating a new one each time
My way re-uses instances too
(Not that that means much, as I'm using a `struct)
Oh
hm
I think this is what I'm looking for, yes