diff options
| author | HampusM <hampus@hampusmat.com> | 2026-12-01 16:45:58 +0100 |
|---|---|---|
| committer | HampusM <hampus@hampusmat.com> | 2026-12-01 16:45:58 +0100 |
| commit | 1d2ded384e2669d8f48a6b138b232d0eecd214d0 (patch) | |
| tree | 024901d141e990dc059a8f30a89e6a9663477149 /engine-ecs-macros | |
| parent | 607de6051f62652ac2799ec73ef0052436be5d62 (diff) | |
refactor(engine-ecs): store component::Info in component::Parts
Diffstat (limited to 'engine-ecs-macros')
| -rw-r--r-- | engine-ecs-macros/src/lib.rs | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/engine-ecs-macros/src/lib.rs b/engine-ecs-macros/src/lib.rs index 4ae83ce..a061165 100644 --- a/engine-ecs-macros/src/lib.rs +++ b/engine-ecs-macros/src/lib.rs @@ -135,9 +135,14 @@ pub fn component_derive(input: TokenStream) -> TokenStream fn into_parts(self) -> #ecs_path::component::Parts { #ecs_path::component::Parts::builder() - .name(<Self as Component>::name()) - .type_name(std::any::type_name::<Self>()) - .type_reflection(<Self as Component>::type_reflection()) + .component_info( + #ecs_path::component::Info::default() + .with_name(<Self as Component>::name()) + .with_type_name(std::any::type_name::<Self>()) + .with_type_reflection( + <Self as Component>::type_reflection() + ) + ) .build( <Self as #ecs_path::component::WithAssociatedId>::id(), self @@ -257,10 +262,14 @@ pub fn sole_derive(input: TokenStream) -> TokenStream fn into_parts(self) -> #ecs_path::component::Parts { #ecs_path::component::Parts::builder() - .name(<Self as Sole>::name()) - .type_name(std::any::type_name::<Self>()) + .component_info( + #ecs_path::component::Info::default() + .with_name(<Self as Sole>::name()) + .with_type_name(std::any::type_name::<Self>()) + .with_is_sole(true) + .with_type_reflection(<Self as Sole>::type_reflection()) + ) .is_sole(true) - .type_reflection(<Self as Sole>::type_reflection()) .build( <Self as #ecs_path::component::WithAssociatedId>::id(), self |
