#include "ZMMOEntity.h"

AZMMOEntity::AZMMOEntity()
{
	PrimaryActorTick.bCanEverTick = false;
	bReplicates = false;
}

void AZMMOEntity::SetZMMOIdentity(const int64 InEntityId, const EZMMOEntityType InEntityType)
{
	EntityId = InEntityId;
	EntityType = InEntityType;
}

void AZMMOEntity::ApplyEntitySnapshot(const FZMMOEntitySnapshot& Snapshot)
{
	const FRotator NewRotation(0.0f, Snapshot.YawDeg, 0.0f);
	SetActorLocationAndRotation(Snapshot.PositionCm, NewRotation);
}

void AZMMOEntity::SetEntityRelevant(const bool bRelevant)
{
	if (bIsZMMORelevant == bRelevant)
	{
		return;
	}

	bIsZMMORelevant = bRelevant;
	SetActorHiddenInGame(!bRelevant);
	SetActorEnableCollision(bRelevant);
	SetActorTickEnabled(bRelevant);
}
