//////////////////////////////////////////////////////////////////////////////
//
// ToolsAVP_Entity_MarineTeam.h
//
// Copyright (C) 2007 Rebellion. All Rights Reserved.
//
//////////////////////////////////////////////////////////////////////////////

// B E G I N   F I L E   W R A P P E R ///////////////////////////////////////

#ifdef ASURA_USE_PRAGMA_ONCE
#pragma once
#endif

#ifndef __TOOLSAVP_ENTITY_MARINETEAM_H__
#define __TOOLSAVP_ENTITY_MARINETEAM_H__ 1

// E N D   F I L E   W R A P P E R ///////////////////////////////////////////

// I N C L U D E S ///////////////////////////////////////////////////////////

// tools
#include "Entity/Tools_Entity_Object.h"

// F O R W A R D   D E C L A R A T I O N S ///////////////////////////////////

class AVP_ServerEntity_Team_Marine;
class ToolsAVP_Entity_MarineSquad;
class ToolsAVP_Entity_HumanSpawnPoint;

//////////////////////////////////////////////////////////////////////////////
//
// ToolsAVP_Entity_MarineTeam
//
//////////////////////////////////////////////////////////////////////////////

class ToolsAVP_Entity_MarineTeam : public Tools_Entity_Object
{
    typedef Tools_Entity_Object PARENT;

public:
    ToolsAVP_Entity_MarineTeam( Asura_Entity* pxEntity );
    virtual ~ToolsAVP_Entity_MarineTeam();

    virtual const char* GetTypeDescription()			{return "Marine Team";}
    virtual bool        CanBeCopied()					{return false;}
    virtual bool        CanBeDestroyed()				{return false;}
    virtual void        UpdatePositionInAsuraData(bool /*updateLinkedObjects*/);
    virtual bool        HandlesThisMessage(int iMessageID);
	virtual bool		HandlesThisEvent(int iEventID) const;
	virtual void		AddOverlayControls(class Asura_Overlay* pxOverlay, class Asura_Vector_2& xOffset);
	virtual void		Update(void);
	virtual void		UpdateWhileSelected(void);
	virtual bool		ShouldAddFilesToExportList() const {return true;}
	virtual void		AddFilesToExportListFromMessage(u_short usMessageID, void* pData, List<Asura_String>& nameList) const;

    static void	Create();
    static Tools_Object* Create(Asura_Entity* pxEntity);
    static ToolsAVP_Entity_MarineTeam* GetInstance() { return s_pxToolsMarineTeam; }

protected:

	void UpdateSquadList(void);

	static void EditSelectedSquad(void);
	static void EditSelectedSquad(int iDummyVariable) {EditSelectedSquad();}

	static void EditSelectedSpawnPoint(void);
	static void EditSelectedSpawnPoint(int iDummyVariable) {EditSelectedSpawnPoint();}

	static void				ChooseMarineBlueprint( void );
	static void				ChooseAndroidBlueprint( void );
	static void				ChooseCivilianBlueprint( void );

	static Asura_Hash_ID	GetDefaultMarineBlueprintHashID( void )		{ return 0xed4b34fc; } //"MarineKnowledge"
	static Asura_Hash_ID	GetDefaultAndroidBlueprintHashID( void )	{ return 0xb66dfeef; } //"AndroidKnowledge"
	static Asura_Hash_ID	GetDefaultCivilianBlueprintHashID( void )	{ return 0x4b5ad85b; } //"CivilianKnowledge"


	
	void	UpdateOverlay(void);
	void	UpdateSelectedSquad(void);
	void	UpdateSelectedSpawnPoint(void);
	void	UpdateSpawnPointsList(void);
	void	UpdateCategoryList(void);
	int		GetNumRowsToDisplay(void);
	int		GetNumEntriesToDisplay(void);

private:
    
	AVP_ServerEntity_Team_Marine*				m_pxMarineTeam;
	bool										m_bChanged;
	
	// There should only ever be one of these in a level.
    static ToolsAVP_Entity_MarineTeam*			s_pxToolsMarineTeam;

	List <ToolsAVP_Entity_MarineSquad*>			m_xMarineSquadList;
	List <ToolsAVP_Entity_HumanSpawnPoint*>		m_xHumanSpawnList;

	static float								s_fRespawnDelay;
    
	// For overlay displaying stuff
	static int									s_iNumSquads;
	static const char**							s_ppszSquadNames;
	static int									s_iSelectedSquad;
	static ToolsAVP_Entity_MarineSquad*			s_pxSelectedSquad;

	static const char**							s_ppszCategoryNames;
	static int									s_iSelectedCategory;
	static int									s_iNumCategories;
	static bool									s_bSelectedCategoryChanged;
	static ToolsAVP_Entity_HumanSpawnPoint*		s_pxSelectedSpawnPoint;


	static const char**							s_ppszHumanSpawnerNames;
	static int									s_iSelectedSpawner;
	static int									s_iNumSpawners;
};

//////////////////////////////////////////////////////////////////////////////
//
// 
//
//////////////////////////////////////////////////////////////////////////////

#endif //__TOOLSAVP_ENTITY_MARINETEAM_H__
