#pragma once

#include "CoreMinimal.h"
#include "Components/SceneComponent.h"
#include "CollisionZoneParams.h"
#include "GameplayTagContainer.h"
#include "Engine/HitResult.h"
#include "ConfigurableCollisionComponent.generated.h"

class UShapeComponent;
class UPrimitiveComponent;
class AActor;

UCLASS(Blueprintable, meta=(BlueprintSpawnableComponent))
class DEADBYDAYLIGHT_API UConfigurableCollisionComponent : public USceneComponent
{
	GENERATED_BODY()

protected:
	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	FCollisionZoneParams _collisionParams;

	UPROPERTY(EditAnywhere)
	TArray<FGameplayTag> _requiredPresenceTag;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	bool _spawnOnAuthorityOnly;

private:
	UPROPERTY(BlueprintReadWrite, Transient, Instanced, meta=(AllowPrivateAccess=true))
	UShapeComponent* _collisionZone;

protected:
	UFUNCTION(BlueprintCallable)
	void OnLevelReadyToPlay();

public:
	UFUNCTION(BlueprintCallable)
	void OnEndOverlap(UPrimitiveComponent* overlappedComponent, AActor* otherActor, UPrimitiveComponent* otherComp, int32 otherBodyIndex);

	UFUNCTION()
	void OnBeginOverlap(UPrimitiveComponent* overlappedComponent, AActor* otherActor, UPrimitiveComponent* otherComp, int32 otherBodyIndex, bool fromSweep, const FHitResult& sweepResult);

public:
	UConfigurableCollisionComponent();
};

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