amethyst / specs

Specs - Parallel ECS

Home Page:https://amethyst.github.io/specs/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Question] Is it possible to group components together (to all be accessed by 1 system)

DaQueenJodi opened this issue · comments

I have a lot of *_Animation components and I want them all to be accessed by my Animator system
is there a way I can group them together similar to how you can group entities together with NullStorage components?
I want to do something like this:

impl<'a> System<'a> for Animator {
    type SystemData = (
        WriteStorage<'a, Animation>, // this is the group of animations
        WriteStorage<'a, Sprite>,
        ReadStorage<'a, AnimationState>,
    );
}

I think you could use something like this:

type AnimationData<'a> = (WriteStorage<'a, AnimationComponent1>, WriteStorage<AnimationComponent2>);

and then use AnimationData in your system.

thanks that's exactly what I was looking for!

closing since the question was answered