#pragma once

#include "CoreMinimal.h"
#include "AsynchronousLoadingElement.h"
#include "Collectable.h"
#include "KillerPowerSpawnableStatusEffectData.h"
#include "KillerPowerSpawnableComponents.h"
#include "Templates/SubclassOf.h"
#include "KillerPower.generated.h"

class UInteractor;
class UBoxPlayerOverlapComponent;
class UDLCCheatComponent;
class AKiller;
class UPowerWidgetPresentationComponent;

UCLASS(Blueprintable, Abstract)
class DBDGAMEPLAY_API AKillerPower : public ACollectable, public IAsynchronousLoadingElement
{
	GENERATED_BODY()

protected:
	UPROPERTY(EditAnywhere, BlueprintReadWrite, meta=(BindWidgetOptional))
	UInteractor* _interactor;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, meta=(BindWidgetOptional))
	UBoxPlayerOverlapComponent* _interactionVolume;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	TArray<FKillerPowerSpawnableStatusEffectData> _survivorStatusEffects;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	TArray<FKillerPowerSpawnableStatusEffectData> _killerStatusEffects;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	TArray<FKillerPowerSpawnableComponents> _survivorComponents;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	TArray<FKillerPowerSpawnableComponents> _killerComponents;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	TSubclassOf<UDLCCheatComponent> _cheatComponentClass;

	UPROPERTY(EditAnywhere, ReplicatedUsing=OnRep_OwningKiller)
	TWeakObjectPtr<AKiller> _owningKiller;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Export)
	TArray<UPowerWidgetPresentationComponent*> _powerWidgetPresentationComponents;

protected:
	UFUNCTION(BlueprintCallable)
	void OnRep_OwningKiller();

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

public:
	AKillerPower();
};

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