#pragma once

#include "CoreMinimal.h"
#include "Components/ActorComponent.h"
#include "EK36SpellSlot.h"
#include "K36SpellSlotData.h"
#include "UObject/NoExportTypes.h"
#include "GameplayTagContainer.h"
#include "K36SpellManagerComponent.generated.h"

class UK36SpellData;

UCLASS(Blueprintable, meta=(BlueprintSpawnableComponent))
class UK36SpellManagerComponent : public UActorComponent
{
	GENERATED_BODY()

private:
	UPROPERTY(EditAnywhere, BlueprintReadWrite, meta=(AllowPrivateAccess=true))
	UK36SpellData* _topSpellData;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, meta=(AllowPrivateAccess=true))
	UK36SpellData* _bottomSpellData;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, meta=(AllowPrivateAccess=true))
	UK36SpellData* _leftSpellData;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, meta=(AllowPrivateAccess=true))
	UK36SpellData* _rightSpellData;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, ReplicatedUsing=OnRep_CurrentlySelectedSpellSlot, meta=(AllowPrivateAccess=true))
	EK36SpellSlot _currentlySelectedSpellSlot;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, ReplicatedUsing=OnRep_SpellsData, meta=(AllowPrivateAccess=true))
	TArray<FK36SpellSlotData> _spellsData;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, meta=(AllowPrivateAccess=true))
	FVector2D _initialOffset;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, meta=(AllowPrivateAccess=true))
	TArray<FVector2D> _numberOfSpellsInitialPositions;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, meta=(AllowPrivateAccess=true))
	float _spellOffsetFromCenter;

	UPROPERTY(EditAnywhere)
	TArray<FGameplayTag> _spellVignetteInvisibleStateTag;

private:
	UFUNCTION(BlueprintCallable)
	void UpdateSpellVignetteVFXActivationState();

	UFUNCTION(BlueprintCallable, Server, Unreliable)
	void Server_SetSelectedSpellSlot_Unreliable(EK36SpellSlot selectedSpellSlot);

	UFUNCTION(BlueprintCallable, Server, Reliable)
	void Server_SetSelectedSpellSlot(EK36SpellSlot selectedSpellSlot);

	UFUNCTION(BlueprintCallable)
	void OnRep_SpellsData();

	UFUNCTION(BlueprintCallable)
	void OnRep_CurrentlySelectedSpellSlot();

	UFUNCTION(BlueprintCallable)
	void OnLevelReadyToPlay();

public:
	virtual void GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const override;

public:
	UK36SpellManagerComponent();
};

FORCEINLINE uint32 GetTypeHash(const UK36SpellManagerComponent) { return 0; }
