#pragma once

#include "CoreMinimal.h"
#include "Subsystems/EngineSubsystem.h"
#include "UObject/SoftObjectPtr.h"
#include "EGameType.h"
#include "EGameTypeModifierName.h"
#include "DBDDesignTunables.generated.h"

class UDesignTunableDataAsset;
class UMenuCameraDesignTunables;
class UDBDTextDesignTunables;
class UDBDCoreUMGDesignTunables;

UCLASS(Blueprintable, Transient)
class DEADBYDAYLIGHT_API UDBDDesignTunables : public UEngineSubsystem
{
	GENERATED_BODY()

public:
	UPROPERTY(EditAnywhere, BlueprintReadWrite, NoClear)
	TSoftObjectPtr<UDesignTunableDataAsset> SoftDesignTunableDataAsset;

private:
	UPROPERTY(EditAnywhere, BlueprintReadWrite, meta=(AllowPrivateAccess=true))
	UDesignTunableDataAsset* DesignTunableDataAsset;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, meta=(AllowPrivateAccess=true))
	UMenuCameraDesignTunables* MenuCameraDesignTunables;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, meta=(AllowPrivateAccess=true))
	UDBDTextDesignTunables* TextTunables;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, meta=(AllowPrivateAccess=true))
	UDBDCoreUMGDesignTunables* CoreUMGDesignTunables;

private:
	UFUNCTION(BlueprintCallable)
	void OnPluginDataPathAdded(const FString& dataPath);

public:
	UFUNCTION(BlueprintPure)
	float GetTunableValue(FName ID, bool warnIfRowMissing) const;

	UFUNCTION(BlueprintPure)
	static FString GetStringManualTunableValue(FName id, const FString& defaultValue, bool warnIfRowMissing);

	UFUNCTION(BlueprintCallable)
	static FString GetStringGameTypeTunable(EGameType gameType, EGameTypeModifierName tunableName);

	UFUNCTION(BlueprintPure)
	static TArray<FString> GetStringArrayManualTunableValue(FName id, const TArray<FString>& defaultValue, bool warnIfRowMissing);

	UFUNCTION(BlueprintCallable)
	static int32 GetIntGameTypeTunable(EGameType gameType, EGameTypeModifierName tunableName);

	UFUNCTION(BlueprintPure)
	static int32 GetInt32ManualTunableValue(FName id, const int32 defaultValue, bool warnIfRowMissing);

	UFUNCTION(BlueprintPure)
	static float GetFloatManualTunableValue(FName id, const float defaultValue, bool warnIfRowMissing);

	UFUNCTION(BlueprintCallable)
	static float GetFloatGameTypeTunable(EGameType gameType, EGameTypeModifierName tunableName);

	UFUNCTION(BlueprintPure)
	static bool GetBoolManualTunableValue(FName id, const bool defaultValue, bool warnIfRowMissing);

	UFUNCTION(BlueprintCallable)
	static bool GetBoolGameTypeTunable(EGameType gameType, EGameTypeModifierName tunableName);

	UFUNCTION(BlueprintCallable)
	static TArray<FString> GetArrayGameTypeTunable(EGameType gameType, EGameTypeModifierName tunableName);

public:
	UDBDDesignTunables();
};

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