Struct: FArchetypeSignature
struct SYSTEMS_API FArchetypeSignature;
Reflection-enabled
Signature of actor components set.
More in depth about archetype signatures in this architecture book section.
Signatures are used internally by USystemsWorld
to allow
identification of to which buckets (archetypes) given set of components
belongs to - that allows for querying iterators over only these actor
components that contain all requested components and omiting ones that
doesn't, which improves performance of querying systems world (which is the
most frequently used operation in systems game architecture, hence the
importance of making it fast).
Note
Although constructing signatures has no real value for common usecases while developing games this API can be useful for users that needs to perform more advanced operations.
Example
// Instead of this:
const auto A = Systems.Query<UShiaComponent>().Count();
// You can do this:
auto Signature = FArchetypeSignature();
if (const auto Index = Systems.ComponentTypeIndex(UShiaComponent::StaticClass()))
{
Signature.EnableBit(Index.GetValue());
}
const auto B = Systems.CountRaw(Signature);
Methods
-
Clear
public: void Clear();
Clears components set.
-
ContainsAll
public: bool ContainsAll( const FArchetypeSignature& Other ) const;
Checks if this signature fully contain component set of another signature.
Used by
USystemsWorld::Query
to filter archetypes that are valid for iteration.
Arguments
-
Other
const FArchetypeSignature& Other
Other signature to compare with.
-
-
ContainsAny
public: bool ContainsAny( const FArchetypeSignature& Other ) const;
-
CountBits
public: uint32 CountBits() const;
Counts bits of enabled components in set.
-
Difference
public: FArchetypeSignature Difference( const FArchetypeSignature& Other ) const;
-
DisableBit
public: void DisableBit( uint32 Index );
-
EnableBit
public: void EnableBit( uint32 Index );
-
Exclude
public: FArchetypeSignature Exclude( const FArchetypeSignature& Other ) const;
-
FArchetypeSignature
public: FArchetypeSignature();
Constructs signature of empty components set.
-
FArchetypeSignature
public: FArchetypeSignature( const FArchetypeSignature& Other );
-
FArchetypeSignature
public: FArchetypeSignature( uint32 Bit );
-
HasBit
public: bool HasBit( uint32 Index ) const;
-
Include
public: FArchetypeSignature Include( const FArchetypeSignature& Other ) const;
-
IsEmpty
public: bool IsEmpty() const;
Checks if components set is empty.
-
Union
public: FArchetypeSignature Union( const FArchetypeSignature& Other ) const;
Documentation built with Unreal-Doc
v1.0.8 tool by PsichiX