diff options
author | HampusM <hampus@hampusmat.com> | 2024-03-29 14:21:03 +0100 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2024-03-29 14:21:03 +0100 |
commit | ec57daa9ef43eafea82769cee348da4dab192f16 (patch) | |
tree | c1c726d153edb12135237f0195f27755ffbd9029 /ecs-macros/src | |
parent | 61dfcf1ba2049bf0375821652e49b0e4c4147623 (diff) |
feat(ecs-macros): implement TypeName for components
Diffstat (limited to 'ecs-macros/src')
-rw-r--r-- | ecs-macros/src/lib.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/ecs-macros/src/lib.rs b/ecs-macros/src/lib.rs index e37d6a4..6fe343f 100644 --- a/ecs-macros/src/lib.rs +++ b/ecs-macros/src/lib.rs @@ -25,6 +25,14 @@ pub fn component_derive(input: TokenStream) -> TokenStream } impl ecs::system::Input for #item_ident {} + + impl ecs::type_name::TypeName for #item_ident + { + fn type_name(&self) -> &'static str + { + std::any::type_name::<Self>() + } + } } .into() } |