#pragma once

#include "CoreMinimal.h"
#include "BlockableBySnowballComponent.h"
#include "Templates/SubclassOf.h"
#include "DBDTunableRowHandle.h"
#include "GeneratorBlockableBySnowballComponent.generated.h"

class UBlockWithSnowballInteraction;
class URemoveSnowFromGeneratorInteraction;
class UChargeableComponent;

UCLASS(Blueprintable, Abstract, meta=(BlueprintSpawnableComponent))
class WINTEREVENT2025_API UGeneratorBlockableBySnowballComponent : public UBlockableBySnowballComponent
{
	GENERATED_BODY()

private:
	UPROPERTY(EditAnywhere, BlueprintReadWrite, meta=(AllowPrivateAccess=true))
	TSubclassOf<UBlockWithSnowballInteraction> _blockWithSnowballInteractionClass;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, meta=(AllowPrivateAccess=true))
	TSubclassOf<URemoveSnowFromGeneratorInteraction> _removeSnowInteractionClass;

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

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

	UPROPERTY(EditAnywhere, BlueprintReadWrite, ReplicatedUsing=OnRep_RemoveSnowChargeableComponent, Instanced, meta=(AllowPrivateAccess=true))
	UChargeableComponent* _removeSnowChargeableComponent;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, ReplicatedUsing=OnRep_BlockStack, meta=(AllowPrivateAccess=true))
	int32 _blockStack;

private:
	UFUNCTION(BlueprintCallable)
	void OnRep_RemoveSnowChargeableComponent();

	UFUNCTION(BlueprintCallable)
	void OnRep_BlockStack();

protected:
	UFUNCTION(BlueprintCallable, BlueprintImplementableEvent, BlueprintCosmetic)
	void Cosmetic_OnBlockStackChanged(int32 blockStack);

	UFUNCTION(BlueprintCallable, BlueprintImplementableEvent, BlueprintCosmetic)
	void Cosmetic_OnBlockBySnowballChanged(bool isBlocked);

private:
	UFUNCTION(BlueprintCallable)
	void Authority_AttachInteractions();

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

public:
	UGeneratorBlockableBySnowballComponent();
};

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