Structure

Entity.ComponentSet

A set of stored components.

Declaration

struct ComponentSet

Overview

The set represents all the components stored on an entity. It can hold only one component of any given type.

Topics

Creating a Set

func set([Component])

Adds all the component in the input array to the set.

Accessing Members

subscript(Component.Type) -> Component?

Gets or sets the component of the specified type.

subscript<T>(T.Type) -> T?

Gets or sets the component of the specified type.

Counting Members

Checking for Membership

func has(Component.Type) -> Bool

Returns a Boolean that indicates whether the set contains a component of the given type.

See Also

Adding Components

var components: Entity.ComponentSet

All the components stored on the entity.