Program Listing for File ZagalaSpecExecutionContextSubsystem.h#

↰ Return to documentation for file (ZagalaSpec/Public/Testability/ZagalaSpecExecutionContextSubsystem.h)

// Copyright (c) 2026, Zagala Game Solutions. All rights reserved.

#pragma once
#include "CoreMinimal.h"
#include "Subsystems/EngineSubsystem.h"
#include "GameplayTagContainer.h"
#include "ZagalaSpecExecutionContextSubsystem.generated.h"

DECLARE_LOG_CATEGORY_EXTERN(LogZagalaSpecExecutionContextSubsystem, Log, All);


UCLASS()
class ZAGALASPEC_API UZagalaSpecExecutionContextSubsystem : public UEngineSubsystem
{
    GENERATED_BODY()

public:
    static UZagalaSpecExecutionContextSubsystem* Get();

    static void CreateExecutionContext(UClass* ContextClass);
    static void ClearCurrentExecutionContext();
    static TObjectPtr<UObject> GetCurrentExecutionContext();


    static TObjectPtr<UObject> BuildExecutionContext(TObjectPtr<UObject> Scenario, UClass* ContextClass);

    static TObjectPtr<UObject> BuildExecutionContext(const FGameplayTag& ScenarioTag, UClass* ContextClass);

    static void SetupContext(TObjectPtr<UObject> Context, TObjectPtr<UObject> Scenario);

private:

    UPROPERTY()
    TObjectPtr<UObject> CurrentExecutionContext;
};