#pragma once

#include "CoreMinimal.h"
#include "AIInteractableTargetInterface.h"
#include "KillerDependentObjectInterface.h"
#include "Interactable.h"
#include "ReverseBearTrapRemover.generated.h"

class UMapActorComponent;
class ADBDPlayerState;
class AKiller;
class UPrimitiveComponent;
class AActor;
class AReverseBearTrap;

UCLASS(Blueprintable)
class DEADBYDAYLIGHT_API AReverseBearTrapRemover : public AInteractable, public IAIInteractableTargetInterface, public IKillerDependentObjectInterface
{
	GENERATED_BODY()

private:
	UPROPERTY(EditAnywhere, BlueprintReadWrite, Replicated, meta=(AllowPrivateAccess=true))
	TArray<int32> _keys;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Replicated, meta=(AllowPrivateAccess=true))
	TArray<int32> _keysSearched;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Instanced, meta=(AllowPrivateAccess=true))
	UMapActorComponent* _mapActor;

	UPROPERTY(EditInstanceOnly, BlueprintReadWrite, Replicated, Transient, meta=(AllowPrivateAccess=true))
	TWeakObjectPtr<ADBDPlayerState> _owningPlayerState;

public:
	UFUNCTION(BlueprintCallable, BlueprintImplementableEvent)
	void PlayRemoveFailMontage();

	UFUNCTION(BlueprintPure)
	bool HasSearchedForKey(int32 keyId) const;

	UFUNCTION(BlueprintPure)
	bool HasKey(int32 keyId) const;

protected:
	UFUNCTION(BlueprintPure)
	AKiller* GetOriginatingKiller() const;

public:
	UFUNCTION(BlueprintPure)
	UMapActorComponent* GetMapActor() const;

	UFUNCTION(BlueprintPure, BlueprintNativeEvent)
	UPrimitiveComponent* GetInteractorPrimitiveComponent() const;

protected:
	UFUNCTION(BlueprintPure)
	AReverseBearTrap* GetAttachedRBT(AActor* player) const;

public:
	UFUNCTION(BlueprintCallable)
	void AddSearchedKey(int32 keyId);

	UFUNCTION(BlueprintCallable)
	void AddKey(int32 keyId);

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

public:
	AReverseBearTrapRemover();
};

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