-
-
Notifications
You must be signed in to change notification settings - Fork 11
Family
ctreffs edited this page Oct 7, 2020
·
6 revisions
public struct Family<R> where R: FamilyRequirementsManaging
Equatable
, Sequence
public init(nexus: Nexus, requiresAll: @autoclosure () -> R.ComponentTypes, excludesAll: [Component.Type])
let traits: FamilyTraitSet
Returns the number of family member entities.
var count: Int
True if this family has no members; false otherwise.
var isEmpty: Bool
var entities: EntityIterator
var entityAndComponents: EntityComponentIterator
@inlinable public func canBecomeMember(_ entity: Entity) -> Bool
@inlinable public func isMember(_ entity: Entity) -> Bool
Destroy all member entities of this family.
@discardableResult public func destroyMembers() -> Bool
True if entities where destroyed, false otherwise.
Create a member entity with the given components assigned.
@discardableResult public func createMember(using builder: () -> R.Components) -> Entity
- builder: The family member builder.
The newly created member entity.
public static func ==(lhs: Family<R>, rhs: Family<R>) -> Bool
public func makeIterator() -> ComponentsIterator
Create a new entity with components required by this family.
@discardableResult public func createMember(with components: R.Components) -> Entity
Since the created entity will meet the requirements of this family it will automatically become member of this family.
- components: The components required by this family.
The newly created entity.
Generated at 2020-11-25T10:28:11+0000 using swift-doc 1.0.0-beta.5.
Types
- ComponentAdded
- ComponentIdentifier
- ComponentInstanceProvider
- ComponentRemoved
- ComponentSingletonProvider
- ComponentTypeProvider
- ComponentsBuilder.Context
- ComponentsBuilderPreview
- DefaultCodingStrategy
- DynamicCodingKey
- DynamicComponentProvider
- DynamicComponentProvider.Closure
- Entity
- Entity.ComponentsIterator
- EntityCreated
- EntityDestroyed
- EntityIdentifier
- EntityState
- EntityStateMachine
- Family
- Family.ComponentsIterator
- Family.EntityComponentIterator
- Family.EntityIterator
- FamilyMemberAdded
- FamilyMemberBuilderPreview
- FamilyMemberRemoved
- FamilyTraitSet
- LinearIncrementingEntityIdGenerator
- ManagedContiguousArray
- Nexus
- Nexus.EntitiesIterator
- Requires1
- Requires2
- Requires3
- Requires4
- Requires5
- Requires6
- Requires7
- Requires8
- Single
- StateComponentMapping
- StringHashing
- UnorderedSparseSet
- UnorderedSparseSet.ElementIterator
Protocols
- CodingStrategy
- Component
- ComponentProvider
- DefaultInitializable
- EntityIdentifierGenerator
- FamilyDecoding
- FamilyEncoding
- FamilyRequirementsManaging
- NexusEvent
- NexusEventDelegate
- RequiringComponents1
- RequiringComponents2
- RequiringComponents3
- RequiringComponents4
- RequiringComponents5
- RequiringComponents6
- RequiringComponents7
- RequiringComponents8
- SingleComponent
- TopLevelDecoder
- TopLevelEncoder