bevyengine / bevyengine/bevy-website

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

Open
#1,389 0 comments 1 reaction 0 assignees View on GitHub
A-Book C-Content
Dominant language
JavaScript
Stars
249
Forks
450
Avg merge
16h 20m
Merged PRs (30d)
6

Description

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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.