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

add version of the ecs's write_world method that takes a pre-boxed … #661

Merged
merged 1 commit into from
Oct 14, 2020

Conversation

blunted2night
Copy link
Contributor

This is a simple change to add an alternate API that allow us to post a "pre-boxed" world writer to the ECS's command queue.

@memoryruins memoryruins added the A-ECS Entities, components, systems, and events label Oct 12, 2020
@cart
Copy link
Member

cart commented Oct 12, 2020

Seems reasonable, but before merging I'd like to know the use case this enables. I'd prefer to keep the api lean unless this unlocks new scenarios.

@blunted2night
Copy link
Contributor Author

blunted2night commented Oct 13, 2020

In my case, I am playing with a keyboard focus system. There is a type erased handler as a property of my keyboard state resource that can generate type erased units of work against the world. I would use it by having an entity, say a text editor, gain focus by setting the handler and having that handler generate a world writer that makes the appropriate changes to what ever entities and components are necessary. Another type of widget would be able to gain focus and handle keyboard input differently without having to share knowledge between components beyond the handler interface.

I think it could be used in additional contexts where runtime polymorphism would allow low frequency work to be easier to express.

@cart
Copy link
Member

cart commented Oct 14, 2020

Cool cool that seems reasonable to me.

@cart cart merged commit 7e23e13 into bevyengine:master Oct 14, 2020
@blunted2night blunted2night deleted the boxed-world-writer branch October 16, 2020 01:33
joshuajbouw pushed a commit to joshuajbouw/bevy that referenced this pull request Oct 24, 2020
…world writer (bevyengine#661)

Co-authored-by: Nathan Jeffords <njeffords@comtechefdata.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ECS Entities, components, systems, and events
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants