#pragma once

#include "CoreMinimal.h"
#include "KillerProjectile.h"
#include "Templates/SubclassOf.h"
#include "UObject/NoExportTypes.h"
#include "Engine/HitResult.h"
#include "Chaos/ChaosEngineInterface.h"
#include "HatchetProjectile.generated.h"

class UPoolableProjectileComponent;
class URotatingMovementComponent;
class UKillerProjectileDodgeComponent;
class USphereComponent;
class AActor;
class UFloatValueStrategy;
class UPrimitiveComponent;

UCLASS(Blueprintable)
class AHatchetProjectile : public AKillerProjectile
{
	GENERATED_BODY()

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

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

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Instanced, meta=(AllowPrivateAccess=true))
	UKillerProjectileDodgeComponent* _killerProjectileDodge;

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

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

	UPROPERTY(EditAnywhere, BlueprintReadWrite, meta=(AllowPrivateAccess=true))
	float _rotationSpeed;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, meta=(AllowPrivateAccess=true))
	TSubclassOf<AActor> _hatchetImpactClass;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, meta=(AllowPrivateAccess=true))
	TSubclassOf<AActor> _enhancedExplosionHitClass;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, meta=(AllowPrivateAccess=true))
	TSubclassOf<AActor> _explosionHitClass;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, meta=(AllowPrivateAccess=true))
	TSubclassOf<AActor> _enhancedExplosionMissClass;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, meta=(AllowPrivateAccess=true))
	TSubclassOf<AActor> _explosionMissClass;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Instanced, meta=(AllowPrivateAccess=true))
	UFloatValueStrategy* _hatchetFarHitDistance;

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);

	UFUNCTION(BlueprintPure)
	bool IsHatchetStrengthEnhanced();

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:
	AHatchetProjectile();
};

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