Searching Entities with multiple Components

Hi,

we are using zay-es and its really great.
Our entities are a combination of multiple components.
The question is, how we can find the entities with matches multiple criteria in multiple components.
for example: We have a component “name” and a component “action”. now we need the entities named “Peter” with the action “running”. The Andfilter isnt working here, because it only matches inside the same component.

thx.
Mario

It is currently a limitation that you can only filter on one component type. However, I’ve also never run into a need for more than one except in cases where something else was wrong with my component design. That’s not to say it’s true in your case but I’d be interested in learning more about the situation just in case there is a better design that avoids the issue.

our components are small and so they are reusable. We are develop a RTS-Game. So we have components like attackable, selectable and so on. For example a weapon is not a hole component (java-class), it a combination of some components, like desribed here https://wiki.jmonkeyengine.org/doku.php/jme3:contributions:entitysystem:introduction

Now we are searching for a special entity, in the example it will be the “Armorred Robot” with some special field values.

Any idea how to solve our problem. Perhaps we can help to extend zay-es here.

Well, are you “searching” in the sense that you need an EntitySet or “searching” in that you just need to find it for one specific case?

Because the former implies there is maybe a missing component type and the latter is not really the job of Zay-ES. It will be no more efficient than grabbing with one component filter and then manually filtering through the set. (As that’s all it would be doing internally.)