-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Enum: Add EnumConverter with underlying type lookup #9
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR!
Have you tested this between client and webview? I think it might not work because webview only considers double for number types, that was why if you have a look at numeric converters, they are all casted to double for that reason to keep the compatibility.
AltV.Community.MValueAdapters.Generators/Converters/Other/EnumConverter.cs
Outdated
Show resolved
Hide resolved
chore: Enum: Discrete differentiation between prefix and suffixes (makes it easier to extend later if necessary)
I've not tested it with a webview, but since all numeric enums are now casted as doubles, this shouldn't be a problem |
Actually, string/char enum isn't a real thing in C# so you can simply get rid of it for this PR. Can you update it so that it just has the underlying type only please? This looks good to be merged without the string/char thing. I had an initial idea of supporting enum serialization as string that you would annotate your class/property with |
I have removed bool, string and char. Only (double) casting is left. |
Perfect, thanks! |
Add enum support. Only supports enum numbers