does registry.any_of<...> cause any mayor overhead? #1156
-
Hello,
The benefit of this is that I only have one system to manage, but i don't know at what cost. Since they are simple equations I think this should be okey? but I am just guessing. thanks |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
Well, technically speaking, if (view.storage<LinearComponent>().contains(entity)) { ... } That said, your loop looks wrong to me. Briefly, the view returns all the entities that have |
Beta Was this translation helpful? Give feedback.
Why not three loops then? It's much faster then iterating all entities with a cascade of
if
s. I mean something like this:Or even three different systems. I don't get why you should iterate all entities and check if they have the right component. Views already do it for you in a sense.