// Project Lab - NHTV Igad

#pragma once

#include "CharacterBase.h"
#include "NetworkPossessable.generated.h"

UCLASS(Abstract)
class UNREALPROJECT_API ANetworkPossessable : public ACharacterBase
{
	GENERATED_BODY()
public:
	ANetworkPossessable();

	virtual void Tick( float DeltaSeconds ) override;

	UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = Camera, meta = (AllowPrivateAccess = "true"))
	class USpringArmComponent* CameraBoom;
	UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = Camera, meta = (AllowPrivateAccess = "true"))
	class UCameraComponent* TopDownCamera;

	virtual void AddMovementInput(FVector WorldDirection, float ScaleValue = 1.0f, bool bForce = false) override;
	virtual void SetCharacterRotation(FRotator rotator);
	virtual void AddControllerYawInput(float Val) override;

protected:
	UFUNCTION(Server, Reliable, WithValidation)
	void m_SetCharacterRotation_Server(float rotation);

	virtual bool m_AllowedToMove();
	virtual bool m_AllowedToRotate();

	void m_SetupCamera();
	void m_UpdateCamera();
};
