// Project Lab - NHTV Igad

#pragma once

#include "SkillObject.h"
#include "Items/ItemBase.h"
#include "BaseSkillObject.generated.h"

class AModifier;

USTRUCT()
struct FSkillItem
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere)
	USkeletalMesh* mesh;
	UPROPERTY(EditAnywhere)
	EItemTypeEnum type;
};

USTRUCT()
struct FSkillItemHolder
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere)
	bool isVisible;
	UPROPERTY(EditAnywhere, meta = (EditCondition = "isVisible"))
	TArray<FSkillItem> itemsToEquip;
	UPROPERTY(EditDefaultsOnly, meta = (EditCondition = "isVisible"))
	UParticleSystem* particleEffect;
};

UENUM(BlueprintType)
enum class ESkillShapeType : uint8
{
	Active = 0,
	Passive,
	Sustain,
	Coop,
};

UCLASS(Blueprintable)
class UNREALPROJECT_API UBaseSkillObject : public USkillObject
{
	GENERATED_BODY()

public:
	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Skill")
	TArray<TSubclassOf<AModifier>> modifiers;
	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Skill")
	TArray<class UAbilityInfo*> abilityEffects;
	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Skill")
	ESkillShapeType skillShapeType;
	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Skill")
	FSkillItemHolder visibleItems;
	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Skill")
	FIntPoint pivot;

	/*
	virtual void Serialize( FArchive& a_ar ) override;

	friend FArchive& operator<<( FArchive& a_ar, UBaseSkillObject& a_v )
	{
		UE_LOG( LogTemp, Warning, TEXT( "UBaseSkillObject: << Operator..." ) );
		return a_ar;
	}
	*/
};
