#pragma once

#include "CoreMinimal.h"
#include "GameFramework/Actor.h"
#include "PerPlatformProperties.h"
#include "DBDTunableRowHandle.h"
#include "K31DroneLaserScanActor.generated.h"

class UMaterialInstance;
class UStaticMeshComponent;
class UGMShadowDepthCaptureComponent;
class UK31DroneLaserOutlineUpdateStrategy;
class UDBDOutlineComponent;
class ULocalPlayerTrackerComponent;

UCLASS(Blueprintable)
class THEK31_API AK31DroneLaserScanActor : public AActor
{
	GENERATED_BODY()

public:
	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	UMaterialInstance* LaserScanMeshMaterial;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	UMaterialInstance* LaserScanMeshMaterialUndetectable;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	float StaticCapturesLightAngle;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	float DynamicCapturesLightAngle;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	float DepthCaptureNearPlaneOffset;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Instanced)
	UStaticMeshComponent* LaserScanSM;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Instanced)
	UGMShadowDepthCaptureComponent* DepthCaptureComponentDynamic;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Instanced)
	UGMShadowDepthCaptureComponent* XDepthCaptureComponentStatic;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Instanced)
	UGMShadowDepthCaptureComponent* YDepthCaptureComponentStatic;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Instanced)
	UGMShadowDepthCaptureComponent* NegXDepthCaptureComponentStatic;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Instanced)
	UGMShadowDepthCaptureComponent* NegYDepthCaptureComponentStatic;

	UPROPERTY(EditAnywhere)
	FPerPlatformInt DynamicDepthCaptureSizeWidth;

	UPROPERTY(EditAnywhere)
	FPerPlatformInt DynamicDepthCaptureSizeHeight;

	UPROPERTY(EditAnywhere)
	FPerPlatformInt StaticDepthCaptureSizeWidth;

	UPROPERTY(EditAnywhere)
	FPerPlatformInt StaticDepthCaptureSizeHeight;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Instanced)
	UK31DroneLaserOutlineUpdateStrategy* _outlineUpdateStrategy;

private:
	UPROPERTY(BlueprintReadWrite, Transient, meta=(AllowPrivateAccess=true))
	UMaterialInstance* _defaultLaserScanMeshMaterial;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, meta=(AllowPrivateAccess=true))
	FDBDTunableRowHandle _scanLineFadeDistance;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Instanced, meta=(AllowPrivateAccess=true))
	UDBDOutlineComponent* _outlineComponent;

	UPROPERTY(BlueprintReadWrite, Transient, Instanced, meta=(AllowPrivateAccess=true))
	ULocalPlayerTrackerComponent* _localPlayerTrackerComponent;

public:
	UFUNCTION(BlueprintCallable)
	void UpdateLaserScanMeshMaterial(UMaterialInstance* newLaserScanMeshMaterial);

	UFUNCTION(BlueprintCallable)
	void SetLaserVisibility(bool visible);

	UFUNCTION(BlueprintCallable)
	void RequestStaticDepthCapturesUpdate();

private:
	UFUNCTION(BlueprintCallable)
	void OnLocallyObservedChanged();

public:
	UFUNCTION(BlueprintCallable)
	void InitDroneLaserScan();

	UFUNCTION(BlueprintCallable)
	void DeactivateDroneLaserScan();

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

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

	UFUNCTION(BlueprintCallable)
	void ActivateDroneLaserScan();

public:
	AK31DroneLaserScanActor();
};

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