// Project Lab - NHTV Igad

#pragma once

#include "NetworkDoodad.h"
#include "NetworkDoor.generated.h"


UCLASS()
class UNREALPROJECT_API ANetworkDoor : public ANetworkDoodad
{
	GENERATED_BODY()

public:
	ANetworkDoor();

	virtual void BeginPlay() override;
	virtual void Tick(float DeltaSeconds) override;

	void ToggleDoor();
	void SetDoorState(bool NewState);

	UPROPERTY(Replicated, EditAnywhere, Category = "Switch Components")
	bool isDoorClosed;
	UPROPERTY(EditAnywhere, Category = "Switch Components")
	float closeAfterTime;
	UPROPERTY(EditAnywhere)
	FColor debugColorCode;

	UPROPERTY(EditAnywhere, Category = "Switch Components")
	float debugSinkDepth;

	UPROPERTY(EditAnywhere, Category = "Switch Components")
	class UBoxComponent* doorCollider;
	UPROPERTY(EditAnywhere)
	class UStaticMeshComponent* meshComponent;

private:
	float m_openTime;
};
