-
Notifications
You must be signed in to change notification settings - Fork 30
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
Add missing public getters and setters to various classes #286
base: master
Are you sure you want to change the base?
Conversation
Although there were already methods for getting, changing, adding, and removing elements, they couldn't be used safely from outside plClothingItem, because there was no way to get the number of elements, which is necessary to know which indices are valid for these methods.
@@ -20,30 +20,25 @@ | |||
#include "PRP/plCreatable.h" | |||
#include "Math/hsGeometry3.h" | |||
|
|||
class HSPLASMA_EXPORT plVertDelta | |||
struct HSPLASMA_EXPORT plVertDelta |
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.
Why were these changed to structs?
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.
It was the simplest way to make all the fields public
. This seemed to be the convention in libHSPlasma for things that only hold simple data values.
But if you like, I can change it back to class
and/or wrap the fields in getters/setters. I don't have opinions on the details here, as long as there's some way to access the data in the class.
These classes were already fully implemented, but had no public API beyond the basic read/write methods, so there was no way to interact with them outside libHSPlasma. This PR adds getters and setters where appropriate and converts some classes to public structs.
This is a somewhat random selection of classes (I was experimenting with PrpShop and these are the ones I stumbled across). There are probably still more places that could use the same treatment.