#pragma once

#include "CoreMinimal.h"
#include "Perk.h"
#include "DeadMansSwitch.generated.h"

class AGenerator;

UCLASS(Blueprintable, meta=(BlueprintSpawnableComponent))
class UDeadMansSwitch : public UPerk
{
	GENERATED_BODY()

private:
	UPROPERTY(EditAnywhere)
	float _generatorBlockingDuration;

	UPROPERTY(BlueprintReadWrite, ReplicatedUsing=OnRep_BlockedGenerator, Transient, meta=(AllowPrivateAccess=true))
	AGenerator* _blockedGenerator;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Replicated, meta=(AllowPrivateAccess=true))
	bool _isActivated;

private:
	UFUNCTION(BlueprintCallable)
	void OnRep_BlockedGenerator(AGenerator* previouslyBlockedGenerator);

public:
	UFUNCTION(BlueprintPure)
	float GetActivationDurationAtLevel() const;

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

public:
	UDeadMansSwitch();
};

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