Class: UDynamicQuery

class SYSTEMS_API UDynamicQuery
    : public UDynamicIterator;

Reflection-enabled

Specifiers:

  • BlueprintType

Dynamic query useful for performing system world queries in blueprints.

One of the goals of Systems Architecture is to provide game designers with means to prototype systems without need for programmers. Dynamic query is a way of performing systems world queries in blueprints. Although blueprint API doesn't have same ergonomics as C++ API because of the lack of lazy iterators on blueprints side, technical game designers still might benefit from quickly testing simple systems without involving programmers into the process and being able to quickly test the idea - it makes failing quicker than it would without technical game designers getting their hands dirty once in a while, which is beneficial to the whole production process in long term.

See USystemsWorld::SpawnQuery.

Example

	UCLASS(BlueprintType)
	class EXAMPLE_API UShiaQueryBundle
	{
		GENERATED_BODY()

	public:
		UPROPERTY(BlueprintReadOnly)
		AActor* Actor = nullptr;

		UPROPERTY(BlueprintReadOnly)
		UShiaComponent* Shia = nullptr;
	};

	auto Query = Systems.DynamicQuery<UShiaQueryBundle>();
	auto* Bundle = NewObject<UShiaQueryBundle>(this, UShiaQueryBundle::StaticClass());
	while (Query->Next(Bundle))
	{
		Bundle->Shia->JustDoIt(Bundle->Actor);
	}

Methods

  • EstimateSizeLeft

    public:
    virtual int EstimateSizeLeft() const override;
    

    Calculates maximum number of items this query can yield.

  • Next

    public:
    virtual UObject* Next() override;
    

    Performs iteration and stores yielded values in returned object.

    Note

    This method uses reflection to figure out properties that gonna store yielded actor and components in returned object.

  • Setup

    public:
    void Setup(
        USystemsWorld* Systems,
        const UClass* Type
    );
    

    Resets internal iterator to state for interating current state of systems world.


    Arguments

    • Systems

      USystemsWorld* Systems
      

      Pointer to systems world to iterate on.

    • Type

      const UClass* Type
      

      Class of object that contains fields where yielded actor and components are gonna be stored.


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