Skip to content
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

GroupComponents function: Allow registering multiple components in a single tuple/array #151

Open
Avokadoen opened this issue Jul 29, 2023 · 2 comments
Assignees

Comments

@Avokadoen
Copy link
Owner

Avokadoen commented Jul 29, 2023

When creating the storage, allow nest tuples of components by simply tagging the neste tuple so that the collection is not parsed as a component:

const group_a = ecez.GroupComponents(.{MyComponentA0, MyComponentA1, MyComponentA2 });
const group_b = ecez.GroupComponents(&[_]type{MyComponentB0, MyComponentB1, MyComponentB2 });

ecez.CreateStorage(.{
        group_a,
        group_b,
        SingleComponent, 
        // ...
    }, .{});
@Avokadoen Avokadoen changed the title Allow registering multple components in a single tuple by tagging the tuple Allow registering multiple components in a single tuple by tagging the tuple Jul 29, 2023
@Avokadoen Avokadoen changed the title Allow registering multiple components in a single tuple by tagging the tuple GroupComponents function: Allow registering multiple components in a single tuple/array Aug 16, 2023
@Avokadoen Avokadoen self-assigned this Aug 16, 2023
@Avokadoen Avokadoen pinned this issue Aug 16, 2023
@Avokadoen
Copy link
Owner Author

Avokadoen commented Aug 17, 2023

CreateStorage can support single depth neste array of types. Then, all GroupComponents does is convert to convert a tuple/struct of components into an array of component types

@Avokadoen
Copy link
Owner Author

UnpackComponents migth be a better name

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant