diff --git a/src/components.rs b/src/components.rs index c680db16..42e8bf49 100644 --- a/src/components.rs +++ b/src/components.rs @@ -45,6 +45,14 @@ pub struct LevelSet { pub iids: HashSet, } +impl LevelSet { + pub fn from_iid>(iid: T) -> Self { + let mut iids = HashSet::default(); + iids.insert(iid.into()); + Self { iids } + } +} + /// [Component] that indicates that an ldtk entity should be a child of the world, not the level. /// /// By default, [LdtkEntity]s are children of the level they spawn in.