From 69d90ece7f54996f0f51fc120a38d37717c5248e Mon Sep 17 00:00:00 2001 From: HampusM Date: Sat, 8 Jun 2024 20:47:35 +0200 Subject: perf(ecs): store components using archetypes --- ecs/src/component.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'ecs/src/component.rs') diff --git a/ecs/src/component.rs b/ecs/src/component.rs index d3b00ef..5c0b9ce 100644 --- a/ecs/src/component.rs +++ b/ecs/src/component.rs @@ -28,6 +28,11 @@ pub trait Component: SystemInput + Any + TypeName #[doc(hidden)] fn as_any(&self) -> &dyn Any; + + fn is_optional(&self) -> bool + { + false + } } impl dyn Component @@ -80,6 +85,11 @@ where { self } + + fn is_optional(&self) -> bool + { + true + } } impl TypeName for Option -- cgit v1.2.3-18-g5258