Avokadoen / ecez

A WIP ecs API for Zig!
MIT License
13 stars 0 forks source link

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

Open Avokadoen opened 1 year ago

Avokadoen commented 1 year ago

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 commented 1 year ago

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 commented 5 months ago

UnpackComponents migth be a better name