//////////////////////////////////////////////////////////////////////////////
//
// ToolsAVP_Entity_PlayerObjective.h
//
// Created by AJK 01 / 10 / 2008
//
// Copyright (c) 2009 Rebellion. All rights reserved.
//
//////////////////////////////////////////////////////////////////////////////

#ifdef ASURA_USE_PRAGMA_ONCE
#pragma once
#endif
#ifndef ToolsAVP_Entity_PlayerObjective_H
#define ToolsAVP_Entity_PlayerObjective_H

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

class ToolsAVP_Entity_PlayerObjective : public Tools_Entity_Object
{
public:

	ToolsAVP_Entity_PlayerObjective						( Asura_Entity* pxEntity );
	virtual ~ToolsAVP_Entity_PlayerObjective			( void );

	static void				                Create						( void );
	static Tools_Object*	                Create						( Asura_Entity* pxEntity);
	static ToolsAVP_Entity_PlayerObjective* FindEntity(Asura_Guid uGuid){ return s_xList.FindEntity(uGuid); }
	static Tools_Object*	CreateAndReturn				( void );
	static void				Project_Create				( void );

	virtual bool			CanBeCopied					( void ) const							{ return ( true ); }
	virtual Tools_Object*	CreateObjectOfThisType		( void ) const;
	virtual const char*		GetTypeDescription			( void )								{ return ( "Player Objective" ); }
	virtual void			OnSelection					( void );
	virtual void			OnDeselection				( void );
	virtual void			AddOverlayControls			( class Asura_Overlay* pxOverlay,class Asura_Vector_2& xOffset );
    virtual void            UpdatePositionInAsuraData   ( bool bUpdateLinkedObjects);
	virtual	void            Update();
	virtual void			Destroy();
	virtual void            Render();
	virtual void			UpdateWhileSelected();
	virtual bool			HandlesThisMessage(int iMessageID);

	static const Asura_Hashed_List < ToolsAVP_Entity_PlayerObjective >* GetList	( void )		{ return &s_xList; }
	static ToolsAVP_Entity_PlayerObjective* GetSelectedObjective					( void )		{ return s_pxSelectedPlayerObjective; }
	static void SelectEntity(void);
	static bool GetHasTarget();
	static void SetSelectedEntity(Asura_Guid uGuid);

private:
	void UpdateTargetGuid();
	void ChooseText();
	void UpdateText();

	static void AddLocationMarker(int iUserData);
	static void ChooseText(int iThis){((ToolsAVP_Entity_PlayerObjective*)iThis)->ChooseText();}


	Asura_Vector_3													m_xPreviousPosition;

	Asura_Overlay* m_pxOverlay;

	static Asura_Hashed_List<ToolsAVP_Entity_PlayerObjective> s_xList;
	static ToolsAVP_Entity_PlayerObjective*					  s_pxSelectedPlayerObjective;
    
	typedef Tools_Entity_Object PARENT;
};
#endif