-
Notifications
You must be signed in to change notification settings - Fork 8
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
How to get the friendly name of a Champion? #58
Comments
Were you able to get the reflection working? When we switched to enums proper @RyadaProductions suggested using attributes rather than the static-lookup based helper functions from before. Switching to enums was definitely the right choice, but looking at this now I feel the helper functions probably should've stuck around (and they're what I did in the Rust version of this library). I'll probably add them back when I have a chance soon. |
My quick sample does work, yes. But it just shows the complexity needed without a helper method provided by Camille. Whats the benefit of nesting the 'Descritpion' inside 'Display'? This breaks a lot of handy enum extensions like the ones from Enums.Net. Not nesting would make the retrieval of the description a one-liner. Nevertheless: A helper method provided by Camille definitely is the best choice - I'm gonna leave that issue open as a reminder. :-) Thanks in advance! |
Sorry for the late reply on this issue despite being pinged in it.. The reason for using the DisplayAttribute is because when making an interface that has a UI you might want to have a different name compared to the actual enum value. Random example |
The extension method
Champion.Name()
as mentioned in the readme does not exist?What is the desired way of accessing the display name of the Champion enum?
The text was updated successfully, but these errors were encountered: