#pragma once

#include "CoreMinimal.h"
#include "StatusEffectViewInterface.h"
#include "CoreBaseHudWidget.h"
#include "Templates/SubclassOf.h"
#include "CoreStatusEffectWidget.generated.h"

class UCoreStatusEffectIcon;
class UGridPanel;

UCLASS(Blueprintable, EditInlineNew)
class UCoreStatusEffectWidget : public UCoreBaseHudWidget, public IStatusEffectViewInterface
{
	GENERATED_BODY()

protected:
	UPROPERTY(EditAnywhere, BlueprintReadWrite, NoClear)
	int32 InactiveThreshold;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, NoClear)
	int32 PrepooledItemAmount;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, NoClear)
	int32 ItemsByColumn;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, NoClear)
	float EvenColumnOffset;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, NoClear)
	TSubclassOf<UCoreStatusEffectIcon> CoreStatusEffectIconClass;

	UPROPERTY(BlueprintReadWrite, meta=(BindWidgetOptional))
	UGridPanel* StatusEffectContainer;

private:
	UPROPERTY(EditInstanceOnly, BlueprintReadWrite, Transient, Instanced, meta=(AllowPrivateAccess=true))
	TArray<UCoreStatusEffectIcon*> _statusEffectPool;

	UPROPERTY(EditInstanceOnly, BlueprintReadWrite, Transient, meta=(AllowPrivateAccess=true))
	TArray<FName> _statusEffectOrder;

	UPROPERTY(EditInstanceOnly, BlueprintReadWrite, Transient, Instanced, meta=(AllowPrivateAccess=true))
	TMap<FName, UCoreStatusEffectIcon*> _statusEffectMap;

protected:
	UFUNCTION(BlueprintPure)
	TMap<FName, UCoreStatusEffectIcon*> GetStatusEffectMap() const;

public:
	UCoreStatusEffectWidget();
};

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