//--------------------------------------------------------------------------------------
//	File	:	AVP_ServerEntity_ShootAt.h
//	Author	:	Gareth Thomas
//	Created	:	18 / 12 / 2007
//	Copyright ( C ) 2006 Rebellion, All Rights Reserved.
//--------------------------------------------------------------------------------------

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

//--------------------------------------------------------------------------------------
//	INCLUDES
//--------------------------------------------------------------------------------------
#include "Entity/Locations/Asura_ServerEntity_Node.h"

//--------------------------------------------------------------------------------------
//	Class	:	AVP_ServerEntity_ShootAt
//	Created	:	18 / 12 / 07
//	Author	:	Gareth Thomas
//--------------------------------------------------------------------------------------
class AVP_ServerEntity_ShootAt : public Asura_ServerEntity_Node
{

public:

	// Public Overridden functions...
	virtual void						WriteToChunkStream		( Asura_Chunk_Stream& xStream ) const;
	virtual void						ReadFromChunkStream		( Asura_Chunk_Stream& xStream );
	virtual bool 						CanBeSavedToChunk		( void ) const							{ return ( true ); }
	virtual bool						IsFilledFromChunkBuffer	( void ) const							{ return ( false ); }
	virtual bool						HasClientEntities		( void ) const							{ return ( false ); }
	virtual void						PostLoadInitialise		( void );

	bool			GetShootAtPlayer( void )							{ return m_bShootAtPlayer; }
	void			SetShootAtPlayer( bool bVal )						{ m_bShootAtPlayer = bVal; }

	bool			GetShouldShootAtLinkedEntity( void )				{ return m_bShootAtLinkedEntity; }
	void			SetShouldShootAtLinkedEntity( bool bVal )			{ m_bShootAtLinkedEntity = bVal; }
	
	Asura_Guid		GetShootAtEntityGuid( void )						{ return m_uLinkedShootAtEntity; }
	void			SetShootAtEntityGuid( Asura_Guid uGuid )			{ m_uLinkedShootAtEntity = uGuid; }

	// Public Static Functions...
	static AVP_ServerEntity_ShootAt*								Create( const Asura_Guid uGuid );
	static AVP_ServerEntity_ShootAt*								FindEntity( Asura_Guid uGuid )			{return s_xList.FindEntity( uGuid );}
	static const Asura_Hashed_List<AVP_ServerEntity_ShootAt>*		GetList( void )							{return &s_xList;}

#ifdef ASURA_TOOLS
	virtual void ApplyChangesForTemplateInstance( class Tools_EntityTemplateInstance* pxInstance );
	virtual bool CanBeIncludedInTemplate( void ) const { return true; }
#endif

protected:

	// Construction / Destruction
	AVP_ServerEntity_ShootAt( const Asura_Guid uGuid );
	virtual ~AVP_ServerEntity_ShootAt( void );

private:

	// Friend classes
	friend class ToolsAVP_Entity_ShootAt;

	// Private typedefs
	typedef Asura_ServerEntity_Node PARENT;

	// Chunk Version
	enum { CURRENT_CHUNK_VERSION = 1 };

	bool			m_bShootAtPlayer;
	bool			m_bShootAtLinkedEntity;
	Asura_Guid		m_uLinkedShootAtEntity;

	// Private statics
	static Asura_Hashed_List<AVP_ServerEntity_ShootAt> s_xList;
};

#endif   // ifndef __AVP_SERVERENTITY_SHOOTAT_H__
