// Project Lab - NHTV Igad

#pragma once
#include "Blueprint/UserWidget.h"
#include "HealthBar.generated.h"

UENUM()
enum class EMinimapIcon : uint8
{
	None = 0,
	Crown,
	MiniBoss,
	Dot,
	Camp,
	Player
};

UCLASS()
class UNREALPROJECT_API UHealthBar : public UUserWidget
{
	GENERATED_BODY()

public:
	UHealthBar(const FObjectInitializer& init);
	virtual void NativeConstruct() override;
	virtual void NativeDestruct() override;

	// Icon ID's
	// 0 = nothing
	// 1 = Crown
	// 2 = Mini-Boss
	// 3 = Dot
	// 4 = Camp
	// 5 = PlayerIcon
	void SetIcon(EMinimapIcon iconID);
	void SetStyle(int32 style);
	void UpdateHealth(int32 curr, int32 max);
	void UpdateMana(int32 curr, int32 max, float blocked = 0.0f);
	void UpdateAlignment(bool friendly);
	void SetName(FString name);

private:
	int32 m_style;
	bool m_friendly;
	class UWidgetSwitcher* m_styleSwitcher;
	class UStatBar* m_HP;
	class UStatBar* m_mana;
	class UStatBar* m_HP1;
	UTextBlock* m_name;
	UImage* m_icon;
	EMinimapIcon m_currentIcon;
	int32 m_updateCount = 0;
};
