#pragma once

#include "CoreMinimal.h"
#include "Components/ActorComponent.h"
#include "GuardInstanceContainer.h"
#include "TunableStat.h"
#include "UObject/SoftObjectPtr.h"
#include "GuardManagerComponent.generated.h"

class AKnightGuard;
class UGuardCatalog;

UCLASS(Blueprintable, meta=(BlueprintSpawnableComponent))
class UGuardManagerComponent : public UActorComponent
{
	GENERATED_BODY()

private:
	UPROPERTY(EditAnywhere, BlueprintReadWrite, ReplicatedUsing=OnRep_Guards, Transient, meta=(AllowPrivateAccess=true))
	TArray<FGuardInstanceContainer> _guardInstanceContainers;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, meta=(AllowPrivateAccess=true))
	TMap<TSoftClassPtr<AKnightGuard>, FTunableStat> _guardCooldownDurations;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, meta=(AllowPrivateAccess=true))
	UGuardCatalog* _guardCatalog;

private:
	UFUNCTION(BlueprintCallable)
	void OnRep_Guards();

public:
	virtual void GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const override;

public:
	UGuardManagerComponent();
};

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