diff options
Diffstat (limited to 'ecs-macros/src')
-rw-r--r-- | ecs-macros/src/lib.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/ecs-macros/src/lib.rs b/ecs-macros/src/lib.rs index 8bef0b6..b178022 100644 --- a/ecs-macros/src/lib.rs +++ b/ecs-macros/src/lib.rs @@ -110,6 +110,10 @@ 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::system::ComponentRefMut; use #ecs_path::system::ComponentRef; use #ecs_path::uid::{Uid, Kind as UidKind}; @@ -138,6 +142,18 @@ pub fn component_derive(input: TokenStream) -> TokenStream Self::id() } + fn get_event_uid(&self, event_kind: ComponentEventKind) -> Uid + { + match event_kind { + ComponentEventKind::Removed => ComponentRemovedEvent::<Self>::id(), + _ => { + panic!( + "Support for event kind {event_kind:?} not implemented!" + ); + } + } + } + fn as_any_mut(&mut self) -> &mut dyn Any { self |