From 82328c9ca16849ec432f9125f4b61ebb63f5e17c Mon Sep 17 00:00:00 2001 From: HampusM Date: Sat, 16 Nov 2024 19:12:12 +0100 Subject: feat(ecs): add component::Metadata of function --- ecs/src/component.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ecs/src/component.rs b/ecs/src/component.rs index 14d3b54..a9894b7 100644 --- a/ecs/src/component.rs +++ b/ecs/src/component.rs @@ -194,6 +194,14 @@ impl Metadata is_optional: component.self_is_optional(), } } + + pub fn of() -> Self + { + Self { + id: ComponentT::id(), + is_optional: ComponentT::is_optional(), + } + } } /// Whether or not a `Component` is optional. -- cgit v1.2.3-18-g5258