diff options
Diffstat (limited to 'ecs-macros')
-rw-r--r-- | ecs-macros/src/lib.rs | 36 |
1 files changed, 2 insertions, 34 deletions
diff --git a/ecs-macros/src/lib.rs b/ecs-macros/src/lib.rs index 862b0b1..647469b 100644 --- a/ecs-macros/src/lib.rs +++ b/ecs-macros/src/lib.rs @@ -110,17 +110,12 @@ pub fn component_derive(input: TokenStream) -> TokenStream use ::std::collections::HashMap; use #ecs_path::component::Component; - use #ecs_path::event::component::{ - Removed as ComponentRemovedEvent, - Kind as ComponentEventKind, - }; use #ecs_path::component::{ Handle as ComponentHandle, HandleMut as ComponentHandleMut }; use #ecs_path::uid::{Uid, Kind as UidKind}; use #ecs_path::system::Input as SystemInput; - use #ecs_path::type_name::TypeName; use super::*; @@ -129,8 +124,6 @@ pub fn component_derive(input: TokenStream) -> TokenStream impl #impl_generics Component for #item_ident #type_generics #where_clause { - type Component = Self; - type HandleMut<'component> = #handle_mut_type; type Handle<'component> = #handle_type; @@ -139,16 +132,9 @@ pub fn component_derive(input: TokenStream) -> TokenStream #get_id } - fn get_event_uid(&self, event_kind: ComponentEventKind) -> Uid + fn name(&self) -> &'static str { - match event_kind { - ComponentEventKind::Removed => ComponentRemovedEvent::<Self>::id(), - _ => { - panic!( - "Support for event kind {event_kind:?} not implemented!" - ); - } - } + std::any::type_name::<Self>() } } @@ -156,15 +142,6 @@ pub fn component_derive(input: TokenStream) -> TokenStream #where_clause { } - - impl #impl_generics TypeName for #item_ident #type_generics - #where_clause - { - fn type_name(&self) -> &'static str - { - std::any::type_name::<Self>() - } - } } } .into() @@ -204,15 +181,6 @@ pub fn sole_derive(input: TokenStream) -> TokenStream self } } - - impl #impl_generics #ecs_path::type_name::TypeName for #item_ident #type_generics - #where_clause - { - fn type_name(&self) -> &'static str - { - std::any::type_name::<Self>() - } - } } .into() } |