#pragma once

#include "CoreMinimal.h"
#include "Subsystems/WorldSubsystem.h"
#include "EDBDCameraViewType.h"
#include "OnMenuCameraViewTransitionStart.h"
#include "OnMenuCameraViewTransitionBP.h"
#include "MenuCameraTransitionParams.h"
#include "MenuCameraView.h"
#include "MenuCameraSystem.generated.h"

class UMenuCameraDesignTunables;
class AMenuCameraActor;
class ACameraActor;
class UCameraComponent;

UCLASS(Blueprintable)
class DEADBYDAYLIGHT_API UMenuCameraSystem : public UWorldSubsystem
{
	GENERATED_BODY()

private:
	UPROPERTY(EditInstanceOnly, BlueprintReadWrite, Transient, meta=(AllowPrivateAccess=true))
	UMenuCameraDesignTunables* _tunables;

	UPROPERTY(EditInstanceOnly, BlueprintReadWrite, Transient, meta=(AllowPrivateAccess=true))
	AMenuCameraActor* _cameraTarget;

	UPROPERTY(EditInstanceOnly, BlueprintReadWrite, Transient, meta=(AllowPrivateAccess=true))
	TMap<EDBDCameraViewType, ACameraActor*> _reservedTargets;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, meta=(AllowPrivateAccess=true))
	EDBDCameraViewType _currentViewType;

	UPROPERTY(BlueprintReadWrite, BlueprintAssignable, meta=(AllowPrivateAccess=true))
	FOnMenuCameraViewTransitionStart _onTransitionStart;

	UPROPERTY(BlueprintReadWrite, BlueprintAssignable, meta=(AllowPrivateAccess=true))
	FOnMenuCameraViewTransitionBP _onTransitionFinishedBP;

public:
	UFUNCTION(BlueprintCallable)
	bool Transition(const FMenuCameraTransitionParams& params);

	UFUNCTION(BlueprintPure)
	bool IsTransitionInProgress() const;

	UFUNCTION(BlueprintPure)
	FMenuCameraView GetTransitionTargetView() const;

	UFUNCTION(BlueprintPure)
	FMenuCameraView GetTransitionInitView() const;

	UFUNCTION(BlueprintPure)
	EDBDCameraViewType GetCurrentCameraViewType() const;

	UFUNCTION(BlueprintPure)
	UCameraComponent* GetCamera() const;

	UFUNCTION(BlueprintPure)
	EDBDCameraViewType GetActiveViewType() const;

	UFUNCTION(BlueprintPure)
	bool CanTransition() const;

public:
	UMenuCameraSystem();
};

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