bevy icon indicating copy to clipboard operation
bevy copied to clipboard

Add a simple `EntityMapper` struct for use in networking

Open alice-i-cecile opened this issue 1 year ago • 4 comments

          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 https://github.com/bevyengine/bevy/pull/11428#discussion_r1467883777

alice-i-cecile avatar Jan 26 '24 20:01 alice-i-cecile

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.

Shatur avatar Jan 26 '24 21:01 Shatur

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

alice-i-cecile avatar Jan 26 '24 21:01 alice-i-cecile

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

Shatur avatar Jan 26 '24 21:01 Shatur

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

alice-i-cecile avatar Jan 26 '24 21:01 alice-i-cecile