diff --git a/editor/src/plugins/absm/toolbar.rs b/editor/src/plugins/absm/toolbar.rs index 621a9f8f7..f2aadde00 100644 --- a/editor/src/plugins/absm/toolbar.rs +++ b/editor/src/plugins/absm/toolbar.rs @@ -250,7 +250,7 @@ impl Toolbar { inner_type_name: std::any::type_name::().to_string(), handle: Default::default(), inner_type_id: TypeId::of::(), - derived_type_ids: N::derived_entity_list().to_vec(), + derived_type_ids: N::derived_types().to_vec(), children: vec![], }; diff --git a/editor/src/plugins/inspector/editors/handle.rs b/editor/src/plugins/inspector/editors/handle.rs index 9c7617dc1..86d11c6fb 100644 --- a/editor/src/plugins/inspector/editors/handle.rs +++ b/editor/src/plugins/inspector/editors/handle.rs @@ -235,7 +235,7 @@ impl Control for HandlePropertyEditor { vec![SelectedHandle { handle: self.value.into(), inner_type_id: TypeId::of::(), - derived_type_ids: T::derived_entity_list().to_vec(), + derived_type_ids: T::derived_types().to_vec(), }], )); } diff --git a/editor/src/scene/selector.rs b/editor/src/scene/selector.rs index c53ed8dad..08ef0cc46 100644 --- a/editor/src/scene/selector.rs +++ b/editor/src/scene/selector.rs @@ -167,7 +167,7 @@ impl From> for SelectedHandle { fn from(value: Handle) -> Self { Self { inner_type_id: TypeId::of::(), - derived_type_ids: T::derived_entity_list().to_vec(), + derived_type_ids: T::derived_types().to_vec(), handle: value.into(), } } diff --git a/fyrox-animation/src/machine/transition.rs b/fyrox-animation/src/machine/transition.rs index 3e3c47917..f5f99df84 100644 --- a/fyrox-animation/src/machine/transition.rs +++ b/fyrox-animation/src/machine/transition.rs @@ -66,12 +66,12 @@ macro_rules! define_two_args_node { file!() } - fn derived_entity_list() -> &'static [TypeId] { + fn derived_types() -> &'static [TypeId] { &[] } - fn query_derived_entity_list(&self) -> &'static [TypeId] { - Self::derived_entity_list() + fn query_derived_types(&self) -> &'static [TypeId] { + Self::derived_types() } fn type_name(&self) -> &'static str { @@ -230,12 +230,12 @@ impl Reflect for NotNode { file!() } - fn derived_entity_list() -> &'static [TypeId] { + fn derived_types() -> &'static [TypeId] { &[] } - fn query_derived_entity_list(&self) -> &'static [TypeId] { - Self::derived_entity_list() + fn query_derived_types(&self) -> &'static [TypeId] { + Self::derived_types() } fn type_name(&self) -> &'static str { diff --git a/fyrox-core-derive/src/reflect.rs b/fyrox-core-derive/src/reflect.rs index 128300353..2894fab45 100644 --- a/fyrox-core-derive/src/reflect.rs +++ b/fyrox-core-derive/src/reflect.rs @@ -460,7 +460,7 @@ fn gen_impl( std::any::type_name::() } - fn derived_entity_list() -> &'static [std::any::TypeId] { + fn derived_types() -> &'static [std::any::TypeId] { static ARRAY: std::sync::LazyLock> = std::sync::LazyLock::new(|| vec![ #types ]); @@ -468,8 +468,8 @@ fn gen_impl( &ARRAY } - fn query_derived_entity_list(&self) -> &'static [std::any::TypeId] { - Self::derived_entity_list() + fn query_derived_types(&self) -> &'static [std::any::TypeId] { + Self::derived_types() } fn doc(&self) -> &'static str { diff --git a/fyrox-core/src/pool/handle.rs b/fyrox-core/src/pool/handle.rs index f2a52b5fb..272b7ae01 100644 --- a/fyrox-core/src/pool/handle.rs +++ b/fyrox-core/src/pool/handle.rs @@ -88,15 +88,15 @@ impl Reflect for Handle { file!() } - fn derived_entity_list() -> &'static [TypeId] + fn derived_types() -> &'static [TypeId] where Self: Sized, { - T::derived_entity_list() + T::derived_types() } - fn query_derived_entity_list(&self) -> &'static [TypeId] { - Self::derived_entity_list() + fn query_derived_types(&self) -> &'static [TypeId] { + Self::derived_types() } fn type_name(&self) -> &'static str { diff --git a/fyrox-core/src/pool/mod.rs b/fyrox-core/src/pool/mod.rs index 6fc22a7e8..8f2e1bea0 100644 --- a/fyrox-core/src/pool/mod.rs +++ b/fyrox-core/src/pool/mod.rs @@ -104,15 +104,15 @@ where file!() } - fn derived_entity_list() -> &'static [TypeId] + fn derived_types() -> &'static [TypeId] where Self: Sized, { &[] } - fn query_derived_entity_list(&self) -> &'static [TypeId] { - Self::derived_entity_list() + fn query_derived_types(&self) -> &'static [TypeId] { + Self::derived_types() } #[inline] diff --git a/fyrox-core/src/reflect.rs b/fyrox-core/src/reflect.rs index 4bedb0597..50e06a3f8 100644 --- a/fyrox-core/src/reflect.rs +++ b/fyrox-core/src/reflect.rs @@ -204,11 +204,11 @@ pub trait Reflect: ReflectBase { where Self: Sized; - fn derived_entity_list() -> &'static [TypeId] + fn derived_types() -> &'static [TypeId] where Self: Sized; - fn query_derived_entity_list(&self) -> &'static [TypeId]; + fn query_derived_types(&self) -> &'static [TypeId]; fn type_name(&self) -> &'static str; @@ -1140,15 +1140,15 @@ macro_rules! blank_reflect { file!() } - fn derived_entity_list() -> &'static [std::any::TypeId] + fn derived_types() -> &'static [std::any::TypeId] where Self: Sized, { &[] } - fn query_derived_entity_list(&self) -> &'static [std::any::TypeId] { - Self::derived_entity_list() + fn query_derived_types(&self) -> &'static [std::any::TypeId] { + Self::derived_types() } fn type_name(&self) -> &'static str { @@ -1213,13 +1213,13 @@ macro_rules! delegate_reflect { file!() } - fn derived_entity_list() -> &'static [std::any::TypeId] { + fn derived_types() -> &'static [std::any::TypeId] { // TODO &[] } - fn query_derived_entity_list(&self) -> &'static [std::any::TypeId] { - Self::derived_entity_list() + fn query_derived_types(&self) -> &'static [std::any::TypeId] { + Self::derived_types() } fn type_name(&self) -> &'static str { @@ -1448,6 +1448,6 @@ mod test { #[test] fn test_derived() { let base = Base; - assert_eq!(base.query_derived_entity_list(), &[TypeId::of::()]) + assert_eq!(base.query_derived_types(), &[TypeId::of::()]) } } diff --git a/fyrox-core/src/reflect/std_impls.rs b/fyrox-core/src/reflect/std_impls.rs index bb8fe2353..8496b57bb 100644 --- a/fyrox-core/src/reflect/std_impls.rs +++ b/fyrox-core/src/reflect/std_impls.rs @@ -304,14 +304,14 @@ macro_rules! impl_reflect_inner_mutability { file!() } - fn derived_entity_list() -> &'static [std::any::TypeId] { + fn derived_types() -> &'static [std::any::TypeId] { // TODO: This seems to be impossible to implement because of `?Sized` trait bound // up above. &[] } - fn query_derived_entity_list(&self) -> &'static [std::any::TypeId] { - T::derived_entity_list() + fn query_derived_types(&self) -> &'static [std::any::TypeId] { + T::derived_types() } fn type_name(&$self) -> &'static str { diff --git a/fyrox-core/src/variable.rs b/fyrox-core/src/variable.rs index 19c0bd38c..cf3bdf9a4 100644 --- a/fyrox-core/src/variable.rs +++ b/fyrox-core/src/variable.rs @@ -374,15 +374,15 @@ where file!() } - fn derived_entity_list() -> &'static [TypeId] + fn derived_types() -> &'static [TypeId] where Self: Sized, { - T::derived_entity_list() + T::derived_types() } - fn query_derived_entity_list(&self) -> &'static [TypeId] { - Self::derived_entity_list() + fn query_derived_types(&self) -> &'static [TypeId] { + Self::derived_types() } #[inline] diff --git a/fyrox-graph/src/lib.rs b/fyrox-graph/src/lib.rs index cbd8f4870..e15e2e737 100644 --- a/fyrox-graph/src/lib.rs +++ b/fyrox-graph/src/lib.rs @@ -233,9 +233,7 @@ where // Handle derived entities handles. entity.as_handle_mut(&mut |handle| { if let Some(handle) = handle { - if handle - .query_derived_entity_list() - .contains(&TypeId::of::()) + if handle.query_derived_types().contains(&TypeId::of::()) && handle.reflect_is_some() && !self.try_map_reflect(handle) { @@ -375,9 +373,7 @@ where entity.as_handle_mut(&mut |handle| { if let Some(handle) = handle { if do_map - && handle - .query_derived_entity_list() - .contains(&TypeId::of::()) + && handle.query_derived_types().contains(&TypeId::of::()) && handle.reflect_is_some() && !self.try_map_reflect(handle) { @@ -1596,12 +1592,12 @@ mod test { self.0.deref_mut().field_mut(name, func) } - fn derived_entity_list() -> &'static [TypeId] { + fn derived_types() -> &'static [TypeId] { &[] } - fn query_derived_entity_list(&self) -> &'static [TypeId] { - Self::derived_entity_list() + fn query_derived_types(&self) -> &'static [TypeId] { + Self::derived_types() } } @@ -1867,7 +1863,7 @@ mod test { fn derived_type_ids(&self, handle: Handle) -> Option> { self.nodes .try_borrow(handle) - .map(|n| n.0.deref().query_derived_entity_list().to_vec()) + .map(|n| n.0.deref().query_derived_types().to_vec()) } fn actual_type_name(&self, handle: Handle) -> Option<&'static str> { diff --git a/fyrox-impl/src/scene/graph/mod.rs b/fyrox-impl/src/scene/graph/mod.rs index 11284f501..f994f3bd1 100644 --- a/fyrox-impl/src/scene/graph/mod.rs +++ b/fyrox-impl/src/scene/graph/mod.rs @@ -1829,7 +1829,7 @@ impl BaseSceneGraph for Graph { fn derived_type_ids(&self, handle: Handle) -> Option> { self.pool .try_borrow(handle) - .map(|n| Box::deref(&n.0).query_derived_entity_list().to_vec()) + .map(|n| Box::deref(&n.0).query_derived_types().to_vec()) } fn actual_type_name(&self, handle: Handle) -> Option<&'static str> { diff --git a/fyrox-impl/src/scene/node/mod.rs b/fyrox-impl/src/scene/node/mod.rs index 03576477c..f37e5be4a 100644 --- a/fyrox-impl/src/scene/node/mod.rs +++ b/fyrox-impl/src/scene/node/mod.rs @@ -533,12 +533,12 @@ impl Reflect for Node { file!() } - fn derived_entity_list() -> &'static [TypeId] { + fn derived_types() -> &'static [TypeId] { &[] } - fn query_derived_entity_list(&self) -> &'static [TypeId] { - Self::derived_entity_list() + fn query_derived_types(&self) -> &'static [TypeId] { + Self::derived_types() } fn type_name(&self) -> &'static str { diff --git a/fyrox-impl/src/scene/ragdoll.rs b/fyrox-impl/src/scene/ragdoll.rs index 01cbb1aa2..898320462 100644 --- a/fyrox-impl/src/scene/ragdoll.rs +++ b/fyrox-impl/src/scene/ragdoll.rs @@ -71,12 +71,12 @@ impl Reflect for Limb { file!() } - fn derived_entity_list() -> &'static [TypeId] { + fn derived_types() -> &'static [TypeId] { &[] } - fn query_derived_entity_list(&self) -> &'static [TypeId] { - Self::derived_entity_list() + fn query_derived_types(&self) -> &'static [TypeId] { + Self::derived_types() } fn type_name(&self) -> &'static str { diff --git a/fyrox-impl/src/script/mod.rs b/fyrox-impl/src/script/mod.rs index 55ade9a66..3d6227046 100644 --- a/fyrox-impl/src/script/mod.rs +++ b/fyrox-impl/src/script/mod.rs @@ -671,12 +671,12 @@ impl Reflect for Script { file!() } - fn derived_entity_list() -> &'static [TypeId] { + fn derived_types() -> &'static [TypeId] { &[] } - fn query_derived_entity_list(&self) -> &'static [TypeId] { - Self::derived_entity_list() + fn query_derived_types(&self) -> &'static [TypeId] { + Self::derived_types() } fn type_name(&self) -> &'static str { diff --git a/fyrox-ui/src/lib.rs b/fyrox-ui/src/lib.rs index 526e74cac..9b4e1021e 100644 --- a/fyrox-ui/src/lib.rs +++ b/fyrox-ui/src/lib.rs @@ -3253,7 +3253,7 @@ impl BaseSceneGraph for UserInterface { fn derived_type_ids(&self, handle: Handle) -> Option> { self.nodes .try_borrow(handle) - .map(|n| n.0.query_derived_entity_list().to_vec()) + .map(|n| n.0.query_derived_types().to_vec()) } fn actual_type_name(&self, handle: Handle) -> Option<&'static str> { diff --git a/fyrox-ui/src/node/mod.rs b/fyrox-ui/src/node/mod.rs index 42840549c..b3f855719 100644 --- a/fyrox-ui/src/node/mod.rs +++ b/fyrox-ui/src/node/mod.rs @@ -283,12 +283,12 @@ impl Reflect for UiNode { file!() } - fn derived_entity_list() -> &'static [TypeId] { + fn derived_types() -> &'static [TypeId] { &[] } - fn query_derived_entity_list(&self) -> &'static [TypeId] { - Self::derived_entity_list() + fn query_derived_types(&self) -> &'static [TypeId] { + Self::derived_types() } fn type_name(&self) -> &'static str {