#pragma once

#include "CoreMinimal.h"
#include "Components/ActorComponent.h"
#include "Templates/SubclassOf.h"
#include "Engine/NetSerialization.h"
#include "K38DashRedirectComponent.generated.h"

class USceneComponent;
class UStatusEffect;
class ASurvivor;
class AKiller;
class AK38Dog;

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

protected:
	UPROPERTY(EditAnywhere, BlueprintReadWrite, meta=(BindWidgetOptional))
	USceneComponent* _cameraSpringArmToRotate;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	float _pitchLimit;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	float _yawMultiplier;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	float _pitchMultiplier;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	float _maxYawPerTick;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	float _fadeToBlackDuration;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	float _fadeToWhiteDuration;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	float _cameraBlendTime;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	float _turnSmoothingTime;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	float _cameraDirectionUpdateThreshold;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	TSubclassOf<UStatusEffect> _killerInstinctEffectClass;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Transient, Export)
	TMap<ASurvivor*, UStatusEffect*> _appliedStatusEffects;

protected:
	UFUNCTION(BlueprintCallable, Server, Unreliable)
	void Server_UpdateCurrentAimDirection(FVector_NetQuantizeNormal direction);

	UFUNCTION(BlueprintPure)
	AKiller* GetOwningPlayer() const;

	UFUNCTION(BlueprintPure)
	AK38Dog* GetDog() const;

	UFUNCTION(BlueprintCallable, BlueprintImplementableEvent)
	void FadeToWhiteKiller(float fadeDuration);

public:
	UK38DashRedirectComponent();
};

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