ten3roberts / flax

Batteries included ECS library for rust with entity relations and much more
74 stars 5 forks source link

QueryBuilder API? #24

Open Olle-Lukowski opened 2 weeks ago

Olle-Lukowski commented 2 weeks ago

I really want to use this ECS for my project, but I want to be able to dynamically construct queries (through a scripting language). I don't think that is currently possible. Maybe we could introduce a QueryBuilder API to allow for this? Similar to both EntityBuilder and SystemBuilder.

ten3roberts commented 2 weeks ago

Yeah absolutely. I've been thinking of something similar, currently using Flax for Ivy.

The question is how we would abstract the component type of the query. Returning an enum isn't always the most convenient for a libary as we do not know which types the scripting language may use.

Do you have an API of how you would like the query builder to look?

I would assume a first step is being able to iteratively add more items of parts to the query dynamically, but using static typing, and then provide some method or component attribute for type marshalling.