How can i get and use Contexts in custom EQS Generator in C++?

i have created a custom eqs generator based on my needs and now i want to generate some points based on a custom context created in BP.

here is my .h file:

class MYGAME_API UEQGenerator_Test: public UEnvQueryGenerator_ProjectedPoints
	UPROPERTY(EditAnywhere, Category = Generator)
		TSubclassOf<class UEnvQueryContext> Center;

    	UPROPERTY(EditAnywhere, Category = Generator)
    		TSubclassOf<class UEnvQueryContext> MyContext;
	virtual void GenerateItems(FEnvQueryInstance& QueryInstance) const override;
	mutable FEnvQueryInstance* CachedQueryInstanceQuerier;

i’ve done this so far for “Center” context that is querier:

void UEQGenerator_Test::GenerateItems(FEnvQueryInstance& QueryInstance) const
    	TArray<FVector> CenterPoints;
    	QueryInstance.PrepareContext(Center, CenterPoints);
    	CachedQueryInstanceQuerier = &QueryInstance;
    	const FVector QuerierLoc = Cast<AActor>(CachedQueryInstanceQuerier->Owner.Get())->GetActorLocation();

and how can i get details of this context(“MyContext”) in code? e.g its location and rotation? what should i do?

ok, i found the answer:

	TArray<AActor*> MyContextActors;
	if (!QueryInstance.PrepareContext(MyContext, MyContextActors))
	for (int32 ContextIndex = 0; ContextIndex < MyContextActors.Num(); ContextIndex++)
		UE_LOG(LogTemp, Warning, TEXT("MyContext Loc is %s"), *MyContextActors[ContextIndex]->GetActorLocation().ToString());

just get the first number of the array in case of using one actor