Photon Quantum 3.0.0

Public Member Functions | Static Public Member Functions | Static Public Attributes | Properties | List of all members
ComponentSet Struct Reference

A bitset representing a set of components. The set can contain up to 512 components. This type is not serializable, as any defining or removing a component type would affect other component indices. More...

Public Member Functions

void Add (int index)
 Adds the element at the specified index to the set. More...
 
void Add< T > ()
 Adds the type's id to the set. More...
 
readonly bool Equals (in ComponentSet other)
 Returns true if both sets are equal. More...
 
override int GetHashCode ()
 
void IntersectWith (in ComponentSet other)
 Returns the set of elements that are both in the set and in the other set. More...
 
readonly bool IsSet (int index)
 Returns true if the set contains the element at the specified index. More...
 
bool IsSet< T > ()
 Returns true if the type's id is in the set. More...
 
readonly bool IsSubsetOf (in ComponentSet other)
 Returns true if the set is a subset of the other set. More...
 
readonly bool IsSupersetOf (in ComponentSet other)
 Returns true if the set is a superset of the other set. More...
 
readonly bool Overlaps (in ComponentSet other)
 Returns true if the set and other have at least one element in common. More...
 
void Remove (in ComponentSet other)
 Removes all elements from the set that are in the other set. More...
 
void Remove (int index)
 Removes the element at the specified index from the set. More...
 
void Remove< T > ()
 Removes the type's id from the set. More...
 
void UnionWith (in ComponentSet other)
 Returns the set of elements that are in the set or in the other set. More...
 

Static Public Member Functions

static ComponentSet Create (ComponentTypeRef componentTypeRef)
 
static ComponentSet Create (ReadOnlySpan< ComponentTypeRef > componentTypeRefs)
 
static ComponentSet Create< T0 > ()
 Creates a new component set with the specified components. More...
 
static ComponentSet Create< T0, T1 > ()
 
static ComponentSet Create< T0, T1, T2 > ()
 
static ComponentSet Create< T0, T1, T2, T3 > ()
 
static ComponentSet Create< T0, T1, T2, T3, T4 > ()
 
static ComponentSet Create< T0, T1, T2, T3, T4, T5 > ()
 
static ComponentSet Create< T0, T1, T2, T3, T4, T5, T6 > ()
 
static ComponentSet Create< T0, T1, T2, T3, T4, T5, T6, T7 > ()
 

Static Public Attributes

const int MAX_COMPONENTS = 512
 Maximum number of components that can be stored in the set. More...
 

Properties

readonly bool IsEmpty [get]
 Returns true if the set is empty. More...
 

Detailed Description

A bitset representing a set of components. The set can contain up to 512 components. This type is not serializable, as any defining or removing a component type would affect other component indices.

See also
ComponentTypeId

Member Function Documentation

◆ Create< T0 >()

static ComponentSet ComponentSet.Create< T0 > ( )
inlinestatic

Creates a new component set with the specified components.

Type Constraints
T0 :unmanaged 
T0 :IComponent 

◆ Equals()

readonly bool ComponentSet.Equals ( in ComponentSet  other)
inline

Returns true if both sets are equal.

◆ IsSubsetOf()

readonly bool ComponentSet.IsSubsetOf ( in ComponentSet  other)
inline

Returns true if the set is a subset of the other set.

◆ Overlaps()

readonly bool ComponentSet.Overlaps ( in ComponentSet  other)
inline

Returns true if the set and other have at least one element in common.

◆ IsSupersetOf()

readonly bool ComponentSet.IsSupersetOf ( in ComponentSet  other)
inline

Returns true if the set is a superset of the other set.

◆ Remove() [1/2]

void ComponentSet.Remove ( in ComponentSet  other)
inline

Removes all elements from the set that are in the other set.

◆ UnionWith()

void ComponentSet.UnionWith ( in ComponentSet  other)
inline

Returns the set of elements that are in the set or in the other set.

◆ IntersectWith()

void ComponentSet.IntersectWith ( in ComponentSet  other)
inline

Returns the set of elements that are both in the set and in the other set.

◆ IsSet()

readonly bool ComponentSet.IsSet ( int  index)
inline

Returns true if the set contains the element at the specified index.

◆ Add()

void ComponentSet.Add ( int  index)
inline

Adds the element at the specified index to the set.

◆ Remove() [2/2]

void ComponentSet.Remove ( int  index)
inline

Removes the element at the specified index from the set.

◆ Add< T >()

void ComponentSet.Add< T > ( )
inline

Adds the type's id to the set.

Type Constraints
T :unmanaged 
T :IComponent 

◆ Remove< T >()

void ComponentSet.Remove< T > ( )
inline

Removes the type's id from the set.

Type Constraints
T :unmanaged 
T :IComponent 

◆ IsSet< T >()

bool ComponentSet.IsSet< T > ( )
inline

Returns true if the type's id is in the set.

Type Constraints
T :unmanaged 
T :IComponent 

Member Data Documentation

◆ MAX_COMPONENTS

const int ComponentSet.MAX_COMPONENTS = 512
static

Maximum number of components that can be stored in the set.

Property Documentation

◆ IsEmpty

readonly bool ComponentSet.IsEmpty
get

Returns true if the set is empty.