summaryrefslogtreecommitdiff
path: root/ecs/src/component.rs
diff options
context:
space:
mode:
Diffstat (limited to 'ecs/src/component.rs')
-rw-r--r--ecs/src/component.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/ecs/src/component.rs b/ecs/src/component.rs
index b2ecf80..f77b55a 100644
--- a/ecs/src/component.rs
+++ b/ecs/src/component.rs
@@ -228,6 +228,11 @@ pub struct Metadata
impl Metadata
{
+ pub fn new_non_optional(id: Uid) -> Self
+ {
+ Self { id, is_optional: false }
+ }
+
pub fn get<ComponentT: Component + ?Sized>(component: &ComponentT) -> Self
{
Self {