#pragma once

#include "CoreMinimal.h"
#include "Engine/DataAsset.h"
#include "GameplayTagContainer.h"
#include "DA_EquipmentConfig.generated.h"

USTRUCT(BlueprintType)
struct PG_FRAMEWORK_API FDamageTypeResistance
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	FGameplayTag DamageType;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	float Resistance = 0.0f;
};

UCLASS(BlueprintType)
class PG_FRAMEWORK_API UDA_EquipmentConfig : public UPrimaryDataAsset
{
	GENERATED_BODY()

public:
	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Config")
	TArray<FDamageTypeResistance> DamageTypeResistances;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Config")
	float Durability = 100.0f;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Config")
	float Weight = 1.0f;

	UFUNCTION(BlueprintCallable, BlueprintPure, Category = "Config")
	float GetResistance(FGameplayTag DamageType) const;
};
