#pragma once

#include "CoreMinimal.h"
#include "Subsystems/WorldSubsystem.h"
#include "AmbianceRequest.h"
#include "AmbianceManagerParams.h"
#include "GameplayTagContainer.h"
#include "GMAmbianceManager.generated.h"

class AGMAmbianceManagerActor;
class UAmbianceManagerDataAsset;
class UCurveFloat;
class UDataTable;

UCLASS(Blueprintable)
class GRAPHICSEXTENSIONS_API UGMAmbianceManager : public UTickableWorldSubsystem
{
	GENERATED_BODY()

private:
	UPROPERTY(EditAnywhere, BlueprintReadWrite, meta=(AllowPrivateAccess=true))
	TArray<FAmbianceRequest> _ambianceStack;

protected:
	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	AGMAmbianceManagerActor* _ambianceManagerActor;

public:
	UFUNCTION(BlueprintCallable)
	void RemoveAmbiance(const UAmbianceManagerDataAsset* assetToLoad, bool overrideTransition, float duration, UCurveFloat* curve);

	UFUNCTION(BlueprintPure)
	bool IsManagerInitialized() const;

	UFUNCTION(BlueprintCallable)
	void InitializeManager(UDataTable* inPriorityTable);

	UFUNCTION(BlueprintCallable)
	void DeinitializeManager();

	UFUNCTION(BlueprintCallable)
	void ApplyAmbiance(const FAmbianceManagerParams& newAmbiance);

	UFUNCTION(BlueprintCallable)
	void AddAmbiance(UAmbianceManagerDataAsset* assetToLoad, bool overrideTransition, float duration, UCurveFloat* curve, const FGameplayTag& tag);

public:
	UGMAmbianceManager();
};

FORCEINLINE uint32 GetTypeHash(const UGMAmbianceManager) { return 0; }
