#ifdef ASURA_USE_AXON
//////////////////////////////////////////////////////////////////////////////
//
// Tools_EntityNode_GS2Attractor.h
//
// Copyright (C) 2008 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 __TOOLS_ENTITYNODE_GS2ATTRACTOR_H__
#define __TOOLS_ENTITYNODE_GS2ATTRACTOR_H__ 1

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

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

// asura
#include "Core/Asura_HashedList.h"

// tools
#include "Entity/Locations/OrientedNode/GamesceneNode/Tools_EntityNode_GS2Node.h"

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

class Asura_ServerNode_GS2Attractor;
template< typename T > class List;

//////////////////////////////////////////////////////////////////////////////
//
// Tools_EntityNode_GS2Attractor
//
//////////////////////////////////////////////////////////////////////////////

class Tools_EntityNode_GS2Attractor : virtual public Tools_EntityNode_GS2Node
{
	typedef Tools_EntityNode_GS2Node PARENT;

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

	virtual const char* GetTypeDescription() { return "GS2 Attractor"; }
	virtual bool IsBaseOrDerivativeOf( int iToolsObjectType ) const;

	virtual const char* GetMyNamePrefix() const { return Tools_EntityNode_GS2Attractor::GetNamePrefix(); }

	virtual void AddOverlayControls( Asura_Overlay* pxNewOverlay, Asura_Vector_2& xOffset );
	virtual void OnSelection();
	virtual void OnDeselection();
	virtual bool HandlesThisMessage( int iMessageID );
	virtual bool OwnsThisMessageBlock( unsigned short usMessageBlockID );
	virtual void Render();
	virtual void Update();
	virtual void UpdateWhileSelected();
	virtual void AddFilesToExportList( List< Asura_String >& xNameList ) const;
	virtual bool GetParameter( Asura_Hash_ID uParamID, Tools_Parameter* pxParam ) const;
	virtual bool SetParameter( Asura_Hash_ID uParamID, const Tools_Parameter* pxParam );
	virtual bool Verify( const bool bAutomatic );

	virtual bool          CanBeCopied() const { return ( Type == TOT_Entity_GS2Attractor ); }
	virtual void          Copy( const Tools_Object* pxObject );
	virtual Tools_Object* CreateObjectOfThisType() const;

	virtual Asura_Guid GetOwnerGuidFromSettings() const;

	static void TransferToolsModeData( Tools_ModeDataFile& xFile );

	static void							  Create();
	static Tools_EntityNode_GS2Attractor* CreateAndReturn();

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

	static const char* GetNamePrefix() { return "GS2A_"; }

protected:
	Asura_ServerNode_GS2Attractor* GetGameGS2Attr() const;

	virtual void AddPropertiesTabControls( Asura_Tabs_Dialog* pxTabsDialogue, Asura_Vector_2& xOffset );
	virtual void AddEnRouteBehaviourTabControls( Asura_Tabs_Dialog* pxTabsDialogue, Asura_Vector_2& xOffset );
	virtual void AddUnderTabsControls( Asura_Overlay* pxNewOverlay, Asura_Vector_2& xOffset );
	virtual void AddAttractParamsDialogs( Asura_Tabs_Dialog* pxTabsDialogue, Asura_Vector_2& xOffset );
	virtual void AddAttractRangeDialogs( Asura_Tabs_Dialog* pxTabsDialogue, Asura_Vector_2& xOffset );
	virtual void AddAttractTypeDialogs( Asura_Tabs_Dialog* pxTabsDialogue, Asura_Vector_2& xOffset );

	virtual Asura_Vector_2* GetDefaultsOverlayPosition() { return &s_xDefaultsOverlayPosition; }
	virtual const char*     GetDefaultsOverlayTitle()    { return "GS2 Attractor Defaults"; }
	virtual u_int           GetDefaultsOverlayID()       { return 0x528021e8; } // Asura_GetHashID( "GS2 Attractor Defaults" )
	virtual void SetDefaultsToThis();
	virtual void AddPropertiesDefaultControls( Asura_Overlay* pxNewOverlay, Asura_Vector_2& xOffset );
	virtual void AddBehaviourDefaultControls( Asura_Overlay* pxNewOverlay, Asura_Vector_2& xOffset );

	bool ShouldUseAttractRange() const { return m_bUseAttractRange; }

	static void PickAttractType();
	static void PickEnRouteBehaviourSet();
	static void SetSpecificEntity( Asura_Guid uGuid );

private:
	static bool IsUsingAttractRange( int iThis );
	static bool IsUsingDefaultAttractRange() { return s_bDefaultUseAttractRange; }
	static void SetSpecificEntity();
	static void DefaultAttractTypeChanged();
	static void SetDefaultSpecificEntity();
	static void SetDefaultSpecificEntity( Asura_Guid uGuid );
	static void PickDefaultAttractType();
	static void PickDefaultEnRouteBehaviourSet( int iThis );

private:
	bool m_bUseAttractRange;
	bool m_bChanged;

	static Tools_EntityNode_GS2Attractor* s_pxThisToolsAttractor;
	enum { MAX_NUM_BEHAVIOUR_STRINGS = 64 };
	static const char* s_aszBehaviourStringList[ MAX_NUM_BEHAVIOUR_STRINGS ];
	static int		   s_iNumListEntries;

	static Asura_Hashed_List< Tools_EntityNode_GS2Attractor > s_xList;

	enum Tabs { TAB_PROPERTIES, TAB_EN_ROUTE_BEHAVIOUR, TAB_AT_NODE_BEHAVIOUR, TAB_END_ENUM };
	static const char* s_aszTabNames[ TAB_END_ENUM ];
	static u_int	   s_uCurrentTab;

	static const u_int uCURRENT_TOOLS_DATA_VERSION = 0;
	static Asura_Vector_2 s_xDefaultsOverlayPosition;
	static bool       s_bRefreshDefaultsOverlay;
	static bool       s_bDefaultUseAttractRange;
	static float      s_fDefaultAttractRange;
	static int	      s_iDefaultAttractType;
	static Asura_Guid s_uDefaultSpecificEntityGuid;
	static int	      s_iDefaultEnRouteBehaviourSet;
};

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

#endif //__TOOLS_ENTITYNODE_GS2ATTRACTOR_H__
#endif // ASURA_USE_AXON
