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

Is it possiable to implicitly query the components like this? #79

Open
Shadowblitz16 opened this issue Oct 11, 2024 · 1 comment
Open
Labels
enhancement New feature or request wontfix This will not be worked on

Comments

@Shadowblitz16
Copy link

So we have this...

public class MovementSystem(World world) : BaseSystem<World, float>(world)
{
    private QueryDescription _description = new QueryDescription().WithAll<Position, Velocity>();
    public override void Update(in float delta)
    {
        base.Update(in delta);
        World.Query(in _description, (ref Position position, ref Velocity velocity) =>
        {
            position.Value += velocity.Value;
        });
    }
}

By using source generators on generics to get varadic generaics can we get something like this?

public class MovementSystem(World world) : BaseSystem<World, float>(world)
{
    public override void Update(in float delta)
    {
        base.Update(in delta);
        World.Query((ref Position position, ref Velocity velocity) =>
        {
            position.Value += velocity.Value;
        });
    }
}
@genaray genaray added enhancement New feature or request wontfix This will not be worked on labels Oct 23, 2024
@genaray
Copy link
Owner

genaray commented Oct 23, 2024

Thats possible, however that would defeat the purpose of the query description... actually filtering the entities. You could theoretically add those yourself tho

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants