-
Notifications
You must be signed in to change notification settings - Fork 6
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
Extended struct functionalities #14
Comments
Regarding One important difference compared to your implementation was that the destination struct was the first argument, and then one or more source structs would follow. In case of overlapping properties, the later source overwrites properties from the earlier sources. Regarding
Personally, the scenarios where I would want to set some extra values after constructing (rather than passing them as constructor parameters to begin with) are so few and far inbetween that I'd be fine with occasional call like Heck, if someone has the kind of constructor they want to pass some extra struct of initial values to, they might just use function HighlyConfigurableStruct(_config) constructor {
struct_assign(self, _config);
init();
static init = function() { ... }
} |
That sounds good too. This is just how i've used them since I use a lot of 'generic' structs (for things like items, weapons, etc). I tend to use structs a lot like objects a lot of the time for non-drawing purposes. I like |
These are some various extended struct functions I use quite often.
Example:
The text was updated successfully, but these errors were encountered: