@@ -13,8 +13,8 @@ use bevy_reflect::FromType;
1313/// See [`SceneEntityMapper`] and [`MapEntities`] for more information.
1414#[ derive( Clone ) ]
1515pub struct ReflectMapEntities {
16- map_all_entities : fn ( & mut World , & mut SceneEntityMapper ) ,
17- map_entities : fn ( & mut World , & mut SceneEntityMapper , & [ Entity ] ) ,
16+ map_all_world_entities : fn ( & mut World , & mut SceneEntityMapper ) ,
17+ map_world_entities : fn ( & mut World , & mut SceneEntityMapper , & [ Entity ] ) ,
1818}
1919
2020impl ReflectMapEntities {
@@ -27,8 +27,12 @@ impl ReflectMapEntities {
2727 /// An example of this: A scene can be loaded with `Parent` components, but then a `Parent` component can be added
2828 /// to these entities after they have been loaded. If you reload the scene using [`map_all_entities`](Self::map_all_entities), those `Parent`
2929 /// components with already valid entity references could be updated to point at something else entirely.
30- pub fn map_all_entities ( & self , world : & mut World , entity_map : & mut EntityHashMap < Entity > ) {
31- SceneEntityMapper :: world_scope ( entity_map, world, self . map_all_entities ) ;
30+ pub fn map_all_world_entities (
31+ & self ,
32+ world : & mut World ,
33+ entity_map : & mut EntityHashMap < Entity > ,
34+ ) {
35+ SceneEntityMapper :: world_scope ( entity_map, world, self . map_all_world_entities ) ;
3236 }
3337
3438 /// A general method for applying [`MapEntities`] behavior to elements in an [`EntityHashMap<Entity>`]. Unlike
@@ -37,29 +41,29 @@ impl ReflectMapEntities {
3741 ///
3842 /// This is useful mostly for when you need to be careful not to update components that already contain valid entity
3943 /// values. See [`map_all_entities`](Self::map_all_entities) for more details.
40- pub fn map_entities (
44+ pub fn map_world_entities (
4145 & self ,
4246 world : & mut World ,
4347 entity_map : & mut EntityHashMap < Entity > ,
4448 entities : & [ Entity ] ,
4549 ) {
4650 SceneEntityMapper :: world_scope ( entity_map, world, |world, mapper| {
47- ( self . map_entities ) ( world, mapper, entities) ;
51+ ( self . map_world_entities ) ( world, mapper, entities) ;
4852 } ) ;
4953 }
5054}
5155
5256impl < C : Component + MapEntities > FromType < C > for ReflectMapEntities {
5357 fn from_type ( ) -> Self {
5458 ReflectMapEntities {
55- map_entities : |world, entity_mapper, entities| {
59+ map_world_entities : |world, entity_mapper, entities| {
5660 for & entity in entities {
5761 if let Some ( mut component) = world. get_mut :: < C > ( entity) {
5862 component. map_entities ( entity_mapper) ;
5963 }
6064 }
6165 } ,
62- map_all_entities : |world, entity_mapper| {
66+ map_all_world_entities : |world, entity_mapper| {
6367 let entities = entity_mapper
6468 . get_map ( )
6569 . values ( )
0 commit comments