//------------------------------------------------------------------------------
// File   : ToolsAVP_Entity_AlienSpawnPoint.h
// Author : Gareth Thomas
// Date   : 22 / 10 / 07
// Copyright (C) 2007 Rebellion, All Rights Reserved.
//------------------------------------------------------------------------------

#ifdef ASURA_USE_PRAGMA_ONCE
#pragma once
#endif   // ifdef ASURA_USE_PRAGMA_ONCE
#ifndef __TOOLSAVP_ENTITY_ALIENSPAWNPOINT_H__
#define __TOOLSAVP_ENTITY_ALIENSPAWNPOINT_H__

//------------------------------------------------------------------------------
// Include files...
//------------------------------------------------------------------------------
#include "Entity/Spawners/ToolsAVP_Entity_SpawnPoint.h"
#include "Entity/Tools_Entity_Object.h"
#include "Entity/Tools_Entity_StartPoint.h"
#include "Interface/Asura_Dialog.h"
#include "Objects/Tools_Object_System.h"

// axon
#include "Core/AVP_Navigation.h"

//------------------------------------------------------------------------------
// Forward class declarations...
//------------------------------------------------------------------------------
class AVP_ServerEntity_AlienSpawnPoint;
class ToolsAVP_Entity_SpawnPoint;

//------------------------------------------------------------------------------
// Class declarations
//------------------------------------------------------------------------------

//------------------------------------------------------------------------------
// Class        : ToolsAVP_Entity_AlienSpawnPoint
// Author       : Gareth Thomas
// Date         : 22 / 10 / 07
// Description  : Class to handle Tools editing of Alien Spawn Points.
//------------------------------------------------------------------------------
class ToolsAVP_Entity_AlienSpawnPoint : public ToolsAVP_Entity_SpawnPoint
{
	typedef ToolsAVP_Entity_SpawnPoint PARENT;

public:

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

	// Public Static functions
	static void				Project_Create				(void);
	static void				Create						(void);
	static Tools_Object*	Create						(Asura_Entity* pxEntity);
	static void				SetSelectedSpawner			(ToolsAVP_Entity_AlienSpawnPoint* pxSpawnPoint);
	static void				ClearSelectedSpawner		(void);
	static void				Rename						(void);
	static void				EditComment					(void);
	static ToolsAVP_Entity_AlienSpawnPoint* CreateAndReturn(void);
	static void				RadiusRender				(void);
	static void				SelectAlienTeam				(void);

	// Public overridden Virtual functions...
	virtual void			OnSelection					(void);
	virtual void			OnDeselection				(void);
	virtual void			UpdateWhileSelected			(void);
	virtual void			Update						(void);
	virtual void			Render						(void);
	virtual const char*		GetTypeDescription			(void)													{return("Alien Spawn Point");}
	virtual void			AddOverlayControls			(Asura_Overlay* pxOverlay, Asura_Vector_2& xOffset);
	virtual bool			CanBeCopied					(void) const											{ return Type == TOT_Entity_AlienSpawnPoint; }
	virtual void			Copy						(const Tools_Object* pxObject);

	virtual Tools_Object*	CreateObjectOfThisType()	const;

	static ToolsAVP_Entity_AlienSpawnPoint*								FindEntity		(Asura_Guid uGuid)		{return s_xList.FindEntity(uGuid);}
	static const Asura_Hashed_List<ToolsAVP_Entity_AlienSpawnPoint>*	GetList			(void)					{return &s_xList;}

	int						GetAgilityValue				(void)													{return m_iSelectedAgility;}

protected:
	// Protected functions
	virtual bool GetParameter(Asura_Hash_ID uParamID,class Tools_Parameter* pxParam) const;
	virtual bool SetParameter(Asura_Hash_ID uParamID,const class Tools_Parameter* pxParam);

	void UpdateToolsObjectName();

	AVP_ServerEntity_AlienSpawnPoint* GetGameAlienSpawnPoint() const;

private:
	// Private functions and operators...
	ToolsAVP_Entity_AlienSpawnPoint						(void);
	ToolsAVP_Entity_AlienSpawnPoint						(const ToolsAVP_Entity_AlienSpawnPoint& xOther);
	ToolsAVP_Entity_AlienSpawnPoint&	operator=		(const ToolsAVP_Entity_AlienSpawnPoint& xOther);

	static void AddSpawnerLink();
	static void StaticAddSpawnerLinkToThis( Asura_Guid uGuid );
	static void DeleteSpawnerLink();
	static void StaticDeleteSpawnerLinkToThis( Asura_Guid uGuid );
	void DeleteSpawnerLinkToThis( Asura_Guid uGuid );
	static bool CanDeleteSpawnerLink();
	static void UpdateAgilityFromSpawnPoint();

	static void RenderLine( const Asura_Vector_3& xStart, const Asura_Vector_3& xEnd,
							const Asura_Vector_3& xStartColour, const Asura_Vector_3& xEndColour );

	float												m_fRadius;
	float												m_fRadiusRenderTimer;

	int													m_iSelectedAgility;
	float												m_fLinkCheckTimer;
	Asura_Vector_3										m_xLastPos;

	static bool											s_bShowAllAlienSpawnPointLinks;
	static ToolsAVP_Entity_AlienSpawnPoint*				s_pxToolsAlienSpawnPoint;
	static const char*									s_ppszAgilityCategoryNames[AVP_Navigation::NUM_AGILITY_RATINGS];

	static Asura_Hashed_List<ToolsAVP_Entity_AlienSpawnPoint> s_xList;
};   /// End of class 'ToolsAVP_Entity_SpawnPoint'.

#endif   // ifndef __TOOLSAVP_ENTITY_SPAWNPOINT_H__
/// End of file 'ToolsAVP_Entity_SpawnPoint'.