summaryrefslogtreecommitdiff
path: root/ecs/src/component.rs
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2024-06-08 20:47:35 +0200
committerHampusM <hampus@hampusmat.com>2024-06-15 16:32:24 +0200
commit69d90ece7f54996f0f51fc120a38d37717c5248e (patch)
treefe2de83e81648762778c1a77041293526c3db9d0 /ecs/src/component.rs
parentbef61b765de52d14a52c3df86f8b3766846be272 (diff)
perf(ecs): store components using archetypes
Diffstat (limited to 'ecs/src/component.rs')
-rw-r--r--ecs/src/component.rs10
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>