//-----------------------------------------------------------------------------
// File			: ToolsAVP_Entity_LookAt.h
// Author		: Gareth Thomas
// Created		: 18 / 12 / 2007
// Copyright (c) 2007 Rebellion. All rights reserved.
//-----------------------------------------------------------------------------

//-----------------------------------------------------------------------------
// Begin File Wrapper
#ifdef ASURA_USE_PRAGMA_ONCE
#pragma once
#endif
#ifndef __TOOLSAVP_ENTITY_LOOKAT_H___
#define __TOOLSAVP_ENTITY_LOOKAT_H___ 1
// End File Wrapper
//-----------------------------------------------------------------------------

//-----------------------------------------------------------------------------
// Includes
//-----------------------------------------------------------------------------
#include "Entity/Locations/Tools_Entity_Node.h"

//-----------------------------------------------------------------------------
// Class		: ToolsAVP_Entity_LookAt
// Author		: Gareth Thomas
// Created		: 18 / 12 / 2007
// Description	: Class to be used as a look at marker for marines and any 
// other entity types that need.
//-----------------------------------------------------------------------------

class AVP_ServerEntity_LookAt;

class ToolsAVP_Entity_LookAt : public Tools_Entity_Node
{

public:

	// Public Construction / Deconstruction functions...
	ToolsAVP_Entity_LookAt							(Asura_Entity* pxEntity);
	virtual ~ToolsAVP_Entity_LookAt					(void);

	// Public Static functions...
	static void				Create						(void);
	static Tools_Object*	Create						(Asura_Entity* pxEntity);
	static Tools_Object*	CreateAndReturn				(void);
	static void				Project_Create				(void);

	// Public Overridden Virtual Functions...
	virtual void			AddOverlayControls			(class Asura_Overlay* pxOverlay, class Asura_Vector_2& xOffset);
	virtual bool			CanBeCopied					(void) const						{return true;}
	virtual void			Copy						(const Tools_Object* pxObject);
	virtual Tools_Object*	CreateObjectOfThisType		(void) const;
	virtual void			Destroy						(void);
	virtual const char*		GetTypeDescription			(void)								{return ("LookAtNode");}
	virtual void			OnSelection					(void);
	virtual void			OnDeselection				(void);
	virtual void			Render						(void);
	virtual void			Update						(void);
	virtual void			UpdateWhileSelected			(void);
	virtual bool			IsBaseOrDerivativeOf( int iToolsObjectType ) const;

	void					SetLinkedLookAt(Asura_Guid uLinkedLookAt)						{m_uLinkedLookAt = uLinkedLookAt;}
	Asura_Guid				GetLinkedLookAt(void)											{return m_uLinkedLookAt;}
	
	static ToolsAVP_Entity_LookAt*							FindEntity(Asura_Guid uGuid)	{return s_xList.FindEntity(uGuid);}
	static const Asura_Hashed_List<ToolsAVP_Entity_LookAt>* GetList(void)					{return &s_xList;}

protected:
	static void	AddLinkedPoint		(void);
	static void DeleteLinkedPoint	(void);

	AVP_ServerEntity_LookAt* GetGameLookAtNode() const;

private:

	typedef Tools_Entity_Node PARENT;

	Asura_Guid											m_uLinkedLookAt;
	bool												m_bChanged;

	static Asura_Hashed_List<ToolsAVP_Entity_LookAt>	s_xList;
	static ToolsAVP_Entity_LookAt*						s_pxSelectedLookAtNode;
};

#endif // __TOOLSAVP_ENTITY_LOOKAT_H___