//----------------------------------------------------------------------------
// File		:	AVP_ServerNode_CoverpointNode.h
// Created	:	28 / 02 / 08
// Author	:	Gareth Thomas
// Copyright (C) 2006 Rebellion, All Rights Reserved.
//----------------------------------------------------------------------------

//----------------------------------------------------------------------------
// BEGIN FILE WRAPPER
#ifdef ASURA_USE_PRAGMA_ONCE
#pragma once
#endif
#ifndef __AVP_SERVERNODE_COVERPOINTNODE_H__
#define __AVP_SERVERNODE_COVERPOINTNODE_H__ 1
// END FILE WRAPPER
//----------------------------------------------------------------------------

//----------------------------------------------------------------------------
// INCLUDES
//----------------------------------------------------------------------------

// asura
#include "Entity/Locations/OrientedNode/CoverpointNode/Asura_ServerNode_Coverpoint.h"

//----------------------------------------------------------------------------
// FORWARD DECLARATIONS
//----------------------------------------------------------------------------
class Tools_EntityTemplateInstance;
class Asura_ServerNode_Coverpoint;

//----------------------------------------------------------------------------
// Class	:	AVP_ServerNode_CoverpointNode
// Created	:	28 / 02 / 08
// Author	:	Gareth Thomas
//----------------------------------------------------------------------------
class AVP_ServerNode_CoverpointNode : public Asura_ServerNode_Coverpoint
{
	friend class ToolsAVP_Entity_CoverpointNode;
	typedef Asura_ServerNode_Coverpoint PARENT;

public:
	enum LowCoverType
	{
		LOW_COVER = 0,
		MID_COVER,
		MAX_LOW_COVER_TYPES
	};

	AVP_ServerNode_CoverpointNode(Asura_Guid uGuid);

	static void CreateFromChunkStream( Asura_Guid uGuid, Asura_Chunk_Stream& xStream );
	virtual	void ReadFromChunkStream( Asura_Chunk_Stream& xStream );
	virtual void WriteToChunkStream( Asura_Chunk_Stream& xStream ) const;
	virtual bool IsBaseOrDerivativeOf(u_short usClassification) const;

	virtual void SetIsOccupied(const bool bIsOccupied);

#ifdef ASURA_TOOLS
	virtual bool CanBeIncludedInTemplate() const;
	virtual void ApplyChangesForTemplateInstance( Tools_EntityTemplateInstance* pxInstance );
#endif

	static AVP_ServerNode_CoverpointNode* Create(Asura_Guid uGuid);

	Asura_Guid	GetLinkedCoverPointGuid(u_int uIndex)						{return m_auLinkedCoverPointGuids[uIndex];}
	void		SetLinkedCoverPointGuid(u_int uIndex, Asura_Guid uGuid)		{m_auLinkedCoverPointGuids[uIndex] = uGuid;}

	u_int		GetNumLinkedCoverPoints(void)								{return m_uNumLinkedCoverPoints;}
	void		SetNumLinkedCoverPoints(u_int uNumLinkedCoverPoints)		{m_uNumLinkedCoverPoints = uNumLinkedCoverPoints;}

	void		SetLowCoverType(int iType)									{ m_iLowCoverType = iType; }
	int			GetLowCoverType(void)										{ return m_iLowCoverType; }

private:
	enum { MAX_LINKED_COVERPOINTS = 4 };

	Asura_Guid	m_auLinkedCoverPointGuids[MAX_LINKED_COVERPOINTS];
	u_int		m_uNumLinkedCoverPoints;
	int			m_iLowCoverType;

private:
	enum { CURRENT_CHUNK_VERSION = 4 };
};

//----------------------------------------------------------------------------
//
// 
//
//----------------------------------------------------------------------------
#endif //__AVP_SERVERNODE_COVERPOINTNODE_H__
