//-----------------------------------------------------------------------------
// File			: ToolsAVP_Node_FleePoint.h
// Author		: Gareth Thomas
// Created		: 06 / 03 / 08
// Copyright (c) 2007 Rebellion. All rights reserved.
//-----------------------------------------------------------------------------

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

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

#include "ToolsAVP_ChooseObjects.h"

class ToolsAVP_ChooseFleeAction;

//-----------------------------------------------------------------------------
// Class		: ToolsAVP_Node_FleePoint
// Author		: Gareth Thomas
// Created		: 18 / 12 / 2007
// Description	: Class to be used as a formation marker for marines and any 
// other entity types that need.
//-----------------------------------------------------------------------------
class ToolsAVP_Node_FleePoint : public Tools_Entity_Node
{

public:

	// Public Construction / Deconstruction functions...
	ToolsAVP_Node_FleePoint							(Asura_Entity* pxEntity);
	virtual ~ToolsAVP_Node_FleePoint					(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 bool			IsBaseOrDerivativeOf		(int iToolsObjectType) const;
	virtual bool			CanBeCopied					(void) const						{return true;}
	virtual Tools_Object*	CreateObjectOfThisType		(void) const;
	virtual const char*		GetTypeDescription			(void)								{return ("FleePoint");}
	virtual void			OnSelection					(void);
	virtual void			OnDeselection				(void);
	virtual void			AddOverlayControls			(class Asura_Overlay* pxOverlay,class Asura_Vector_2& xOffset);
	virtual void			UpdateWhileSelected			(void);
	virtual void			Update						(void);
	virtual void			Render						(void);

	static const Asura_Hashed_List<ToolsAVP_Node_FleePoint>* GetList(void)					{return &s_xList;}

	static ToolsAVP_Node_FleePoint* GetSelectedFleeObject()	{ return s_pxSelectedFleePointNode; }

protected:

	Asura_LinkList<Asura_Guid>								m_xActionList;

private:

	friend  ToolsAVP_ChooseFleeAction;
	typedef Tools_Entity_Node PARENT;

	static void SelectActionToAdd( void );
	static void SelectActionToRemove( void );
	static void AddAction( Asura_Guid uGuid );
	static void RemoveAction( Asura_Guid uGuid );

	

	static Asura_Hashed_List<ToolsAVP_Node_FleePoint>		s_xList;
	static ToolsAVP_Node_FleePoint*							s_pxSelectedFleePointNode;
	static bool												s_bChanged;

	
};

class ToolsAVP_ChooseObject_ByType;

//----------------------------------------------------------------------------------
// Class        : ToolsAVP_ChooseGS2Object
// Author       : Gareth Thomas
// Date         : 06 / 06 / 08
// Description  : For Choosing Game Scene Objects
//----------------------------------------------------------------------------------
class ToolsAVP_ChooseFleeAction : public ToolsAVP_ChooseObject_ByType
{
public:

	typedef ToolsAVP_ChooseObject_ByType PARENT;

	ToolsAVP_ChooseFleeAction( const int iStructureType, bool bAdd, Asura_Guid* puGuidToSet, bool* pbChanged = NULL )
	: PARENT( 0, puGuidToSet, pbChanged)
	, m_iStructureType(iStructureType)
	, m_bAdd(bAdd)
	{
	}

	ToolsAVP_ChooseFleeAction( const int iStructureType, bool bAdd, void( *pfnOnChosen )( Asura_Guid ), bool* pbChanged = NULL )
	: PARENT( 0, pfnOnChosen, pbChanged)
	, m_iStructureType(iStructureType)
	, m_bAdd(bAdd)
	{
	}

	virtual bool CanBeSelected( Tools_Object* pxObject );

	int		m_iStructureType;
	bool	m_bAdd;
};

#endif // __TOOLSAVP_NODE_FLEEPOINT_H___