diff options
author | HampusM <hampus@hampusmat.com> | 2024-06-08 20:47:35 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2024-06-15 16:32:24 +0200 |
commit | 69d90ece7f54996f0f51fc120a38d37717c5248e (patch) | |
tree | fe2de83e81648762778c1a77041293526c3db9d0 /ecs/src/component.rs | |
parent | bef61b765de52d14a52c3df86f8b3766846be272 (diff) |
perf(ecs): store components using archetypes
Diffstat (limited to 'ecs/src/component.rs')
-rw-r--r-- | ecs/src/component.rs | 10 |
1 files changed, 10 insertions, 0 deletions
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<ComponentT> TypeName for Option<ComponentT> |