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 a simple EntityMapper struct for use in networking #11549

Closed
alice-i-cecile opened this issue Jan 26, 2024 · 4 comments · Fixed by #11583
Closed

Add a simple EntityMapper struct for use in networking #11549

alice-i-cecile opened this issue Jan 26, 2024 · 4 comments · Fixed by #11583
Labels
A-ECS Entities, components, systems, and events C-Feature A new feature, making something new possible D-Trivial Nice and easy! A great choice to get started with Bevy

Comments

@alice-i-cecile
Copy link
Member

          That's the behaviour I'd prefer to have for networking, as I don't want/need the complexities associated with the existing EntityMapper. (Having to use `EntityMapper::world_scope()` and needing access to `&mut World`)

I will remove this from the PR as users can implement it themselves

Originally posted by @cBournhonesque in #11428 (comment)

@alice-i-cecile alice-i-cecile added C-Feature A new feature, making something new possible A-ECS Entities, components, systems, and events labels Jan 26, 2024
@Shatur
Copy link
Contributor

Shatur commented Jan 26, 2024

I'm not sure if it's possible to have a general enough struct for networking.
In replicon I have different mapper for events and components, for example. Since it's just a few lines of code, I would left it for libraries to implement.

@alice-i-cecile
Copy link
Member Author

Mhmm. Might be more useful as an example? It's hard to say: networking is a nasty beast.

@Shatur
Copy link
Contributor

Shatur commented Jan 26, 2024

Yes, an example would be good. But maybe worth to put into rustdoc to the trait description?

@alice-i-cecile
Copy link
Member Author

Yeah, I like this a lot as a doc test.

@alice-i-cecile alice-i-cecile added the D-Trivial Nice and easy! A great choice to get started with Bevy label Jan 26, 2024
github-merge-queue bot pushed a commit that referenced this issue Jan 29, 2024
# Objective

Fixes: #11549 

Add a doctest example of what a custom implementation of an
`EntityMapper` would look like.

(need to wait until #11428 is
merged)

---------

Co-authored-by: Charles Bournhonesque <[email protected]>
Co-authored-by: Alice Cecile <[email protected]>
Co-authored-by: Hennadii Chernyshchyk <[email protected]>
tjamaan pushed a commit to tjamaan/bevy that referenced this issue Feb 6, 2024
# Objective

Fixes: bevyengine#11549 

Add a doctest example of what a custom implementation of an
`EntityMapper` would look like.

(need to wait until bevyengine#11428 is
merged)

---------

Co-authored-by: Charles Bournhonesque <[email protected]>
Co-authored-by: Alice Cecile <[email protected]>
Co-authored-by: Hennadii Chernyshchyk <[email protected]>
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 C-Feature A new feature, making something new possible D-Trivial Nice and easy! A great choice to get started with Bevy
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants