#pragma once

#include "CoreMinimal.h"
#include "KillerProjectile.h"
#include "GameplayTagContainer.h"
#include "UObject/NoExportTypes.h"
#include "Engine/HitResult.h"
#include "Chaos/ChaosEngineInterface.h"
#include "KillerProjectileAbilityProjectile.generated.h"

class USphereComponent;
class UPoolableProjectileComponent;
class URotatingMovementComponent;
class UPrimitiveComponent;
class AActor;

UCLASS(Blueprintable, Abstract)
class DBDGAMEPLAY_API AKillerProjectileAbilityProjectile : public AKillerProjectile
{
	GENERATED_BODY()

protected:
	UPROPERTY(EditAnywhere, BlueprintReadWrite, Instanced)
	USphereComponent* _targetDetector;

	UPROPERTY(EditAnywhere)
	FGameplayTag _hitSurvivorScoreEvent;

private:
	UPROPERTY(EditAnywhere, BlueprintReadWrite, Instanced, meta=(AllowPrivateAccess=true))
	UPoolableProjectileComponent* _poolableProjectile;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Instanced, meta=(AllowPrivateAccess=true))
	USphereComponent* _collision;

	UPROPERTY(BlueprintReadWrite, Transient, Instanced, meta=(AllowPrivateAccess=true))
	URotatingMovementComponent* _rotatingMovement;

private:
	UFUNCTION()
	void OnComponentHit(UPrimitiveComponent* hitComponent, AActor* otherActor, UPrimitiveComponent* otherComponent, FVector normalImpulse, const FHitResult& hitResult);

protected:
	UFUNCTION(BlueprintCallable, BlueprintImplementableEvent)
	void OnActivationChanged(bool enabled);

private:
	UFUNCTION(BlueprintCallable)
	void OnAcquiredChanged(bool isAcquired);

protected:
	UFUNCTION(BlueprintCallable, BlueprintImplementableEvent, BlueprintCosmetic)
	void Cosmetic_OnSlashableDetected();

	UFUNCTION(BlueprintCallable, BlueprintImplementableEvent, BlueprintCosmetic)
	void Cosmetic_OnPlayerDetected();

	UFUNCTION(BlueprintCallable, BlueprintImplementableEvent, BlueprintCosmetic)
	void Cosmetic_OnLaunchNoImpact();

	UFUNCTION(BlueprintCallable, BlueprintImplementableEvent, BlueprintCosmetic)
	void Cosmetic_OnCollisionDetected(EPhysicalSurface surfaceType);

public:
	AKillerProjectileAbilityProjectile();
};

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