From 720f806b7fa770664c3ebdf2ce3ec9fdeb69bbcf Mon Sep 17 00:00:00 2001 From: HampusM Date: Sun, 16 Jun 2024 13:18:58 +0200 Subject: chore(ecs-macros): add id function to component impls --- ecs-macros/src/lib.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'ecs-macros') diff --git a/ecs-macros/src/lib.rs b/ecs-macros/src/lib.rs index a3ddc2a..21e8053 100644 --- a/ecs-macros/src/lib.rs +++ b/ecs-macros/src/lib.rs @@ -59,6 +59,11 @@ pub fn component_derive(input: TokenStream) -> TokenStream type RefMut<'component> = #ecs_path::system::ComponentRefMut<'component, Self>; + fn id(&self) -> #ecs_path::component::Id + { + #ecs_path::component::Id::of::() + } + fn as_any_mut(&mut self) -> &mut dyn std::any::Any { self -- cgit v1.2.3-18-g5258