#pragma once

#include "CoreMinimal.h"
#include "UObject/NoExportTypes.h"
#include "AssetViewDataSourceLoadingStateChanged.h"
#include "AssetViewDataSourceSelectionStateChanged.h"
#include "BhvrAssetViewOption.h"
#include "BhvrAssetViewDataSource.generated.h"

class UBhvrAssetViewData;

UCLASS(Blueprintable, Abstract, Transient)
class BHVRASSETVIEWER_API UBhvrAssetViewDataSource : public UObject
{
	GENERATED_BODY()

public:
	UPROPERTY(BlueprintReadWrite, BlueprintAssignable)
	FAssetViewDataSourceLoadingStateChanged LoadingStateChanged;

	UPROPERTY(BlueprintReadWrite, BlueprintAssignable)
	FAssetViewDataSourceSelectionStateChanged AssetViewDataSelectionStateChanged;

protected:
	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	FString Id;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	FString DisplayName;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	TArray<FBhvrAssetViewOption> AssetViewDataOptions;

	UPROPERTY(EditInstanceOnly, BlueprintReadWrite, Transient)
	TMap<FString, UBhvrAssetViewData*> AssetViewDatas;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	bool bIsLoading;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	UBhvrAssetViewData* SelectedAssetViewData;

public:
	UFUNCTION(BlueprintCallable)
	void SelectAssetViewData(const FString& AssetViewDataId);

	UFUNCTION(BlueprintPure)
	bool IsLoading() const;

	UFUNCTION(BlueprintPure)
	UBhvrAssetViewData* GetSelectedAssetViewData() const;

	UFUNCTION(BlueprintPure)
	FString GetId() const;

	UFUNCTION(BlueprintPure)
	FString GetDisplayName() const;

public:
	UBhvrAssetViewDataSource();
};

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