Open fl215 opened 1 day ago
additional information: you could rename where
to whereAll
and add a whereAny
where any of the conditions must pass
This seems like a decent idea, but needs more consideration for the precise API and how it fits into our future plans for queries and relationships.
I would also note that in this specific example, you could benefit from just giving your entities with the Tool
component additional components like Weapon
and Potion
. You'd also get increased performance out of Matter by doing so.
I would also note that in this specific example, you could benefit from just giving your entities with the
Tool
component additional components likeWeapon
andPotion
. You'd also get increased performance out of Matter by doing so.
you are right, I should have thought more about the examples, these examples may not seem very great but in more complex game structures it might pose a benefit.
Problem
there is some boilerplate in this code that I don't think people should have to always be writing and there could be mistakes done, like writing
return
instead ofcontinue
Proposed solution
fixing this solution by introducing the
where
methodreading it also pretty intuitive: query Tool where Tool's type is weapon
some more useful examples:
there can also be functions