#pragma once

#include "CoreMinimal.h"
#include "Presenter.h"
#include "EHudParentContainerType.h"
#include "HudPresenter.generated.h"

class ADBDPlayer;
class ADBDSpectator;
class UHudScreen;
class UCoreHudRootWidget;
class APawn;

UCLASS(Blueprintable, Abstract, EditInlineNew)
class DBDUIPRESENTERS_API UHudPresenter : public UPresenter
{
	GENERATED_BODY()

protected:
	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	EHudParentContainerType HudParentContainer;

	UPROPERTY(BlueprintReadWrite, Transient)
	ADBDPlayer* _pendingCharacter;

private:
	UPROPERTY(BlueprintReadWrite, Transient, meta=(AllowPrivateAccess=true))
	ADBDPlayer* _presentedCharacter;

	UPROPERTY(BlueprintReadWrite, Transient, meta=(AllowPrivateAccess=true))
	ADBDSpectator* _spectatorPawn;

	UPROPERTY(BlueprintReadWrite, Transient, meta=(AllowPrivateAccess=true))
	UHudScreen* _hudScreen;

	UPROPERTY(BlueprintReadWrite, Transient, Instanced, meta=(AllowPrivateAccess=true))
	UCoreHudRootWidget* _rootWidget;

private:
	UFUNCTION(BlueprintCallable)
	void OnPawnUnpossessed(APawn* pawn);

	UFUNCTION(BlueprintCallable)
	void OnPawnPossessed(APawn* pawn);

protected:
	UFUNCTION(BlueprintCallable)
	void OnLocallyObservedChanged();

private:
	UFUNCTION(BlueprintCallable)
	bool IsVisibleForCurrentGameMode() const;

protected:
	UFUNCTION(BlueprintCallable)
	bool IsPlayerStateReady() const;

private:
	UFUNCTION(BlueprintCallable)
	bool IsPendingPawnReady() const;

	UFUNCTION(BlueprintCallable)
	bool IsHudReady();

protected:
	UFUNCTION(BlueprintCallable)
	bool IsGameStateReady() const;

public:
	UHudPresenter();
};

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