Arch.Extended
Arch.Extended copied to clipboard
Is it possiable to implicitly query the components like this?
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;
});
}
}
Thats possible, however that would defeat the purpose of the query description... actually filtering the entities. You could theoretically add those yourself tho