#pragma once

#include "CoreMinimal.h"
#include "ChaseComponent.h"
#include "ChaseUpdateInfo.h"
#include "GameplayTagContainer.h"
#include "ChaserCharacterComponent.generated.h"

class UDBDPawnSensingComponent;
class ADBDPlayer;
class ASurvivor;
class APawn;

UCLASS(Blueprintable, meta=(BlueprintSpawnableComponent))
class DEADBYDAYLIGHT_API UChaserCharacterComponent : public UChaseComponent
{
	GENERATED_BODY()

private:
	UPROPERTY(BlueprintReadWrite, Transient, Instanced, meta=(AllowPrivateAccess=true))
	UDBDPawnSensingComponent* _camperSensor;

	UPROPERTY(BlueprintReadWrite, Transient, meta=(AllowPrivateAccess=true))
	TMap<ADBDPlayer*, FChaseUpdateInfo> _chaseUpdateInfo;

	UPROPERTY(BlueprintReadWrite, ReplicatedUsing=OnRep_ChasedPlayers, Transient, meta=(AllowPrivateAccess=true))
	TArray<ADBDPlayer*> _chasedPlayers;

	UPROPERTY(BlueprintReadWrite, Transient, meta=(AllowPrivateAccess=true))
	TArray<ADBDPlayer*> _authority_survivorsWhoStunnedKillerByPalletDuringChase;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, meta=(AllowPrivateAccess=true))
	FGameplayTagContainer _preventChaseTags;

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

private:
	UFUNCTION(BlueprintCallable)
	void OnRep_ChasedPlayers() const;

	UFUNCTION(BlueprintCallable)
	void OnKillerLocallyObservedChanged(bool locallyObserved);

	UFUNCTION(BlueprintCallable, NetMulticast, Reliable)
	void Multicast_OnChaseStart(ASurvivor* survivor);

	UFUNCTION(BlueprintCallable, NetMulticast, Reliable)
	void Multicast_OnChaseEnd(ASurvivor* survivor, const FChaseUpdateInfo chaseUpdateInfo);

	UFUNCTION(BlueprintCallable, NetMulticast, Reliable)
	void Multicast_OnAllChaseEnd();

	UFUNCTION(BlueprintCallable)
	void Authority_OnChaseTargetFound(APawn* pawn);

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

public:
	UChaserCharacterComponent();
};

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