diff --git a/Sources/FirebladeECS/Family.swift b/Sources/FirebladeECS/Family.swift index eb7cd73..27ec0e6 100644 --- a/Sources/FirebladeECS/Family.swift +++ b/Sources/FirebladeECS/Family.swift @@ -17,14 +17,16 @@ public struct Family where R: FamilyRequirementsManaging { nexus.onFamilyInit(traits: traits) } - @inlinable public var memberIds: UnorderedSparseSet { + @inlinable var memberIds: UnorderedSparseSet { nexus.members(withFamilyTraits: traits) } + /// Returns the number of family member entities. @inlinable public var count: Int { memberIds.count } + /// True if this family has no members; false otherwise. @inlinable public var isEmpty: Bool { memberIds.isEmpty } @@ -55,7 +57,7 @@ extension Family: Equatable { } extension Family: Sequence { - __consuming public func makeIterator() -> ComponentsIterator { + public func makeIterator() -> ComponentsIterator { ComponentsIterator(family: self) } }