// © 2025 Naked People Team. All Rights Reserved.

#pragma once

#include "CoreMinimal.h"
#include "NakedDesire/MissionBuilder/GoalRestriction.h"
#include "EquipClothingRestriction.generated.h"

class UClothingItemInstance;
class UClothingItemDefinition;

UCLASS(EditInlineNew)
class NAKEDDESIRE_API UEquipClothingRestriction : public UGoalRestriction
{
	GENERATED_BODY()

	UPROPERTY(EditDefaultsOnly, meta = (ToolTip =
		"One of provided clothing items should be equipped by player. If multiple clothing items required provide multiple restrictions"))
	TArray<UClothingItemDefinition*> ClothingItems;

public:
	virtual void Init(ANakedDesireCharacter* PlayerCharacter) override;
	virtual void Stop() override;
	virtual FText GetDescription() const override;

private:
	FDelegateHandle ClothingEquippedDelegateHandle;
	FDelegateHandle ClothingUnequippedDelegateHandle;

	UFUNCTION()
	void OnClothingEquipped(UClothingItemInstance* ClothingItemInstance);

	UFUNCTION()
	void OnClothingUnequipped(UClothingItemInstance* ClothingItemInstance);
	
	void CheckClothing();
};
