genaray/Arch

Query with more then 24 types?

Shadowblitz16 opened this issue · 4 comments

Is it possible to create a QueryDescription with more then 24 types?

I would just chain WithAll in a for loop but there is no WithAll overload that accepts a single argument

Is it possible to create a QueryDescription with more then 24 types?

I would just chain WithAll in a for loop but there is no WithAll overload that accepts a single argument

Theres an overload that accepts one argument: .WithAll<T>().
However there alternatives, e.g. you could create a QueryDescription raw like this: new QueryDescription(){ All = new []{ typeof(Component), typeof(OtherComponent), ...}} :)

@genaray the problem with that is it doesn't accept a instance so T can't be figured out with something like a Type[]
since you can't pass a Type into a T generic parameter

I was looking for something like...
.WithAll<T>(T t0)

I was looking for something like...
.WithAll<T>(T t0)

Hmm i dont really get what you want. Why would you want to pass a value to a QueryDescription?
If you want to query for more than 24 types you can simply configurate it like this:

var queryDesc = new QueryDescription(){ 
    All = new []{ typeof(Component), typeof(OtherComponent), ...},
    Any = ...
    None = ...
}

nvm I realized .WithAll<T>() was what I was looking for.
I think I got confused due to there not being a 0 at the end of T like in .WithAll<T0, T1>()

weird.