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;
    

    Checks if this signature at least partially contain component set of another signature.


    Arguments

    • Other

      const FArchetypeSignature& Other
      

      Other signature to compare with.

  • CountBits

    public:
    uint32 CountBits() const;
    

    Counts bits of enabled components in set.

  • Difference

    public:
    FArchetypeSignature Difference(
        const FArchetypeSignature& Other
    ) const;
    

    Returns signature with only component set bits that differs between this and another signature.


    Arguments

    • Other

      const FArchetypeSignature& Other
      

      Other signature to test with.

  • DisableBit

    public:
    void DisableBit(
        uint32 Index
    );
    

    Disable component bit at given index.


    Arguments

    • Index

      uint32 Index
      

      Index of component bit to disable.

  • EnableBit

    public:
    void EnableBit(
        uint32 Index
    );
    

    Enable component bit at given index.


    Arguments

    • Index

      uint32 Index
      

      Index of component bit to enable.

  • Exclude

    public:
    FArchetypeSignature Exclude(
        const FArchetypeSignature& Other
    ) const;
    

    Exclude components set bits from ones of another signature.


    Arguments

    • Other

      const FArchetypeSignature& Other
      

      Other signature to exclude from.

  • FArchetypeSignature

    public:
    FArchetypeSignature();
    

    Constructs signature of empty components set.

  • FArchetypeSignature

    public:
    FArchetypeSignature(
        const FArchetypeSignature& Other
    );
    

    Copies signature from another one.


    Arguments

    • Other

      const FArchetypeSignature& Other
      

      Other signature to copy components set from.

  • FArchetypeSignature

    public:
    FArchetypeSignature(
        uint32 Bit
    );
    

    Constructs signature with single component bit enabled.


    Arguments

    • Bit

      uint32 Bit
      

      Index of component bit to enable.

  • HasBit

    public:
    bool HasBit(
        uint32 Index
    ) const;
    

    Checks if component bit at given index is enabled.


    Arguments

    • Index

      uint32 Index
      

      Index of component bit to check.

  • Include

    public:
    FArchetypeSignature Include(
        const FArchetypeSignature& Other
    ) const;
    

    Include components set bits from ones of another signature.


    Arguments

    • Other

      const FArchetypeSignature& Other
      

      Other signature to include from.

  • IsEmpty

    public:
    bool IsEmpty() const;
    

    Checks if components set is empty.

  • Union

    public:
    FArchetypeSignature Union(
        const FArchetypeSignature& Other
    ) const;
    

    Returns signature with only component set bits enabled by both signatures.


    Arguments

    • Other

      const FArchetypeSignature& Other
      

      Other signature to test with.


Documentation built with Unreal-Doc v1.0.8 tool by PsichiX