-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Field Read and Write Overloading for Prefereneces #2322
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.
Pretty sick
Though i think you can instead immediately do return get().value = value;
i forgot codestyle exists whoopsm.. |
This looks like a great bit of code cleanup! Also, the codestyle is bugged, it should be allowing inner assignment in return statements. |
> Also, the codestyle is bugged, it should be allowing inner assignment in return statements. - [EliteMasterEric](FunkinCrew#2322 (comment))
I just looked into this more and I actually don't think this is much of an improvement over the existing |
This adds an abstracted
PreferenceMap
, which behaves as a StringMap but with some field read and write overloading.So now instead of needing to call:
You can accomplish the same thing with:
There are other use cases for this but I'm tired and cannot bring myself to list them all right now