ChatImproVR / chatimprovr

A Virtual World Platform for the future
https://chatimprovr.github.io/
Other
10 stars 1 forks source link

Multiple queries #50

Closed Masterchef365 closed 1 year ago

Masterchef365 commented 1 year ago

Allows one to make multiple queries from a single system. See the multiple_queries example!

This is a breaking change. Queries now have names; individual queries are declared like so:

sched
    .add_system(Self::update)
    .query("My Query Name")
        .intersect::<MyComponent>(Access::Write)
        .qcommit()
    .query("My Other Query Name")
        .intersect::<MyOtherComponent>(Access::Write)
        .qcommit()
    .build();

Queries are then referenced by their name:

for key in query.iter("My Query Name") {
    // ...
}