Command Buffer without world in constructor
skelitheprogrammer opened this issue · 2 comments
As I was developing a prototype in DefaultECS, a thought occurred to me.
"Why are queries tied to worlds?" - They don't deal with worlds. They only deal with entities. So do systems. Systems operate on entities (its components). To access the components of an entity, queries are often used. Queries are simply descriptions of what set of entities the system is interested in.
I really like that in Arch Worlds don't have tight relationship with systems and queries. You write world.InlineQuery<YourOperation>(query);
and its possible to use same query and system with different worlds at the same time(I found this really cool)
But Command Buffers are coupled with worlds instance.
What if Command buffers would be able to work with multiple worlds?
Entity entity = buffer.Create(archetype);
buffer.Set<SomeComponent>(entity);
buffer.PlayBack(world);
Is that make sense?
Thats actually a good idea! That would work and would further decouple the buffer from the world itself.