#pragma once

#include "CoreMinimal.h"
#include "Perk.h"
#include "EInventoryType.h"
#include "EPerkInteractionObjectType.h"
#include "Hoarder.generated.h"

class ASearchable;
class ACollectable;
class ASurvivor;
class AActor;

UCLASS(Blueprintable, meta=(BlueprintSpawnableComponent))
class UHoarder : public UPerk
{
	GENERATED_BODY()

private:
	UPROPERTY(EditInstanceOnly, BlueprintReadWrite, Transient, meta=(AllowPrivateAccess=true))
	TArray<ASearchable*> _chests;

	UPROPERTY(EditAnywhere)
	float _camperInteractItemPickupRevealRange;

	UPROPERTY(EditAnywhere)
	int32 _extraChestsSpawned;

	UPROPERTY(EditAnywhere)
	float _bubbleIndicatorLifetime;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, meta=(AllowPrivateAccess=true))
	bool _showUniqueChestVisualPerState;

private:
	UFUNCTION(BlueprintCallable)
	void OnItemRemovedFromPlayer(ACollectable* item, EInventoryType inventoryType);

	UFUNCTION(BlueprintCallable)
	void OnItemAddedToPlayer(ACollectable* item, EInventoryType inventoryType, ASurvivor* player);

protected:
	UFUNCTION(BlueprintCallable, BlueprintImplementableEvent)
	void Local_ThrowBubbleIndicator(const EPerkInteractionObjectType camperInteractionType, const AActor* objectActor, const ASurvivor* interactingCamperPlayer);

	UFUNCTION(BlueprintPure)
	float GetBubbleIndicatorLifetime() const;

public:
	UHoarder();
};

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