#pragma once

#include "CoreMinimal.h"
#include "ClothingItemDefinition.h"
#include "NakedDesire/Items/ItemInstance.h"
#include "ClothingItemInstance.generated.h"

class UClothingItemDefinition;

/** Per-instance mutable state for clothing. */
USTRUCT()
struct FClothingInstanceState : public FItemInstanceState
{
	GENERATED_BODY()

	UPROPERTY(SaveGame)
	float Condition = 1.0f;
};

UCLASS(BlueprintType)
class NAKEDDESIRE_API UClothingItemInstance : public UItemInstance
{
	GENERATED_BODY()

public:
	UPROPERTY(BlueprintReadOnly, Category = "Clothing Item")
	float Condition = 1.0f;

	UClothingItemDefinition* GetClothingItemDefinition() const { return Cast<UClothingItemDefinition>(ItemDefinition); }

	void Init(UClothingItemDefinition* InClothingItem);

protected:
	virtual void CaptureState(FInstancedStruct& OutState) const override;
	virtual void ApplyState(const FInstancedStruct& InState) override;
};