#pragma once

#include "CoreMinimal.h"
#include "SurvivorStatusInterface.h"
#include "Components/ActorComponent.h"
#include "TagStateBool.h"
#include "DBDTunableRowHandle.h"
#include "Templates/SubclassOf.h"
#include "TunableStat.h"
#include "EContaminator.h"
#include "SurvivorContaminationComponent.generated.h"

class UChargeableComponent;
class UStatusEffect;
class UInteractionDefinition;

UCLASS(Blueprintable, meta=(BlueprintSpawnableComponent))
class THEK24_API USurvivorContaminationComponent : public UActorComponent, public ISurvivorStatusInterface
{
	GENERATED_BODY()

private:
	UPROPERTY(EditAnywhere, BlueprintReadWrite, Replicated, meta=(AllowPrivateAccess=true))
	FTagStateBool _isContaminated;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, ReplicatedUsing=OnRep_InjectSerumChargeable, Transient, Export, meta=(AllowPrivateAccess=true))
	UChargeableComponent* _injectSerumChargeable;

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

	UPROPERTY(EditAnywhere, BlueprintReadWrite, meta=(AllowPrivateAccess=true))
	TSubclassOf<UStatusEffect> _hinderedEffect;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, meta=(AllowPrivateAccess=true))
	FTunableStat _contaminationHinderedSeconds;

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

	UPROPERTY(EditAnywhere, BlueprintReadWrite, meta=(AllowPrivateAccess=true))
	TArray<TSubclassOf<UInteractionDefinition>> _injectSerumInteractionsClasses;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, ReplicatedUsing=OnRep_InjectSerumInteractions, Transient, Export, meta=(AllowPrivateAccess=true))
	TArray<UInteractionDefinition*> _injectSerumInteractions;

private:
	UFUNCTION(BlueprintCallable)
	void OnRep_InjectSerumInteractions();

	UFUNCTION(BlueprintCallable)
	void OnRep_InjectSerumChargeable();

	UFUNCTION(BlueprintCallable, NetMulticast, Unreliable)
	void Multicast_OnContaminated(EContaminator contaminator);

public:
	UFUNCTION(BlueprintPure)
	bool IsContaminated() const;

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

public:
	USurvivorContaminationComponent();
};

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