inda21plusplus / Project-Delta

This is the repository for the group project assignment in the course "Project in Introduction to Computer Science" (DD1396), by the Inda21plusplus group.
MIT License
8 stars 0 forks source link

ECS - Optional Queries #37

Closed foodelevator closed 2 years ago

foodelevator commented 2 years ago

Add support for specifying queries that match even entities that don't have a given component, but still get access to it if it does.

Current syntax looks like this:

query_iter!(world, (a: A, b: Option<B>) => {
    // a: &A
    // b: Option<&B>
});
query_iter!(world, (a: mut Option<A>) => {
    // a: Option<&mut A>
});