diff options
author | HampusM <hampus@hampusmat.com> | 2024-06-16 13:18:58 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2024-06-16 13:18:58 +0200 |
commit | 720f806b7fa770664c3ebdf2ce3ec9fdeb69bbcf (patch) | |
tree | 916e116ec306c4cc2cbb0872f79012ef17e1005d | |
parent | d50a2f6e63c25adf3b64652310c423717bd3966f (diff) |
chore(ecs-macros): add id function to component impls
-rw-r--r-- | ecs-macros/src/lib.rs | 5 |
1 files changed, 5 insertions, 0 deletions
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::<Self>() + } + fn as_any_mut(&mut self) -> &mut dyn std::any::Any { self |