//
// AVP_ServerEntity_StartPoint.cpp
//
// Created by JG - 03 March 2009
//
// Copyright (C) 2009 Rebellion  All Rights Reserved.
//

#include "Core/Asura.h"

// This file's header.
#include "AVP_ServerEntity_StartPoint.h"

// Asura
#include "Entity/Asura_Entity_Classification.h"
#include "ChunkSystem/Asura_Chunk_Stream.h"

Asura_Hashed_List<AVP_ServerEntity_StartPoint> AVP_ServerEntity_StartPoint::s_xList;

//////////////////////////////////////////////////////////////////////////
//	Static create functions
//////////////////////////////////////////////////////////////////////////
AVP_ServerEntity_StartPoint* AVP_ServerEntity_StartPoint::Create(Asura_Guid uGuid)
{
	return new AVP_ServerEntity_StartPoint(uGuid);
}

void AVP_ServerEntity_StartPoint::CreateFromChunkBuffer(Asura_Guid uGuid, const char*& pcChunkBuffer)
{
	AVP_ServerEntity_StartPoint* pxStartPoint = new AVP_ServerEntity_StartPoint(uGuid);
	if(pxStartPoint)
	{
		Asura_Chunk_ChunkBuffer_Stream xStream( pcChunkBuffer );
		pxStartPoint->ReadFromChunkStream( xStream );
	}
}

////////////////////////////////////////////////////////////
//  Constructor / Destructor
////////////////////////////////////////////////////////////

AVP_ServerEntity_StartPoint::AVP_ServerEntity_StartPoint(Asura_Guid uGuid)
: PARENT(uGuid)
, m_uLastActorSpawnedGuid( ASURA_GUID_UNREGISTERED )
{
	// I don't need a new classfication for this entities, still using the engine one
	Classification	= AsuraEntityClass_StartPoint;

	// BUT I need them in the project entity lists
	s_xList.AddToList(this);
}

AVP_ServerEntity_StartPoint::~AVP_ServerEntity_StartPoint()
{
	s_xList.RemoveFromList(this);
}