Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allowing for using named entity modifiers together with switchable tags #376

Open
jtferson opened this issue Apr 15, 2021 · 0 comments
Open
Labels
enhancement New feature or request

Comments

@jtferson
Copy link
Sponsor Contributor

Describe the problem you are trying to solve.
Currently we can match against regular entities with switchable tags but narrowing that down to just singleton or specific entities is not possible. It might be useful to have such matching logic in order to have global state machines.

Describe the solution you'd like
The query signature that contains switchable tags with named modifiers properly matches:

auto Slow = ecs.entity("Slow");
auto Normal = ecs.entity("Normal");
auto Fast = ecs.entity("Fast");
auto GlobalSpeed = ecs.type("GlobalSpeed", "Slow, Normal, Fast");
	
ecs.entity("GameArena")
    .add_switch(GlobalSpeed)
    .add_case(Slow);

ecs.query<>("Position, Velocity, GameArena:CASE | Slow").iter([&](flecs::iter& It)
{
});
@jtferson jtferson added the enhancement New feature or request label Apr 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant