diff options
author | HampusM <hampus@hampusmat.com> | 2025-03-17 22:08:45 +0100 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2025-03-17 23:08:53 +0100 |
commit | ee7c0cb713891ae480407f56823289f3fe3b9807 (patch) | |
tree | 8c0fa0bd98050ccd74ab0c9100d12c057bdea6cd /ecs/src/component.rs | |
parent | 64eddc633cea0f4bc5603cc2d4c4c6eafac5c177 (diff) |
fix(ecs): correct oversights made in component storage rewrite
Diffstat (limited to 'ecs/src/component.rs')
-rw-r--r-- | ecs/src/component.rs | 5 |
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 { |