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

Need better guidance / design patterns for dyn traits in components. #1389

Open
viridia opened this issue Jun 11, 2024 · 0 comments
Open

Need better guidance / design patterns for dyn traits in components. #1389

viridia opened this issue Jun 11, 2024 · 0 comments

Comments

@viridia
Copy link

viridia commented Jun 11, 2024

One area that I still struggle with is dyn traits inside of ECS components. Examples of questions that arise frequently:

  • Do I really need to use Arc here, or can I get away with using Box?
  • Under what circumstances do I need to use a mutex?
  • Do I need to blindly add Send + Sync + 'static to every trait declaration, or can I get away with just some of them?
  • I want to downcast the dyn trait in the component into some other trait, what's the best way to do that?

It would be nice if there was a guide which explored these questions in some depth.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants