//////////////////////////////////////////////////////////////////////////////
//
// ToolsAVP_Entity_PickupObject.h
//
// Created by AJK 26/08/2008
//
// Copyright (c) 2008 Rebellion. All rights reserved.
//
//////////////////////////////////////////////////////////////////////////////

#ifdef ASURA_USE_PRAGMA_ONCE
#pragma once
#endif

#ifndef __TOOLSAVP_ENTITY_PICKUPOBJECT__
#define __TOOLSAVP_ENTITY_PICKUPOBJECT__

#include "Entity/PhysicalObject/ToolsAVP_Entity_PhysicalObject.h"

class AVP_ServerEntity_Pickup;

class ToolsAVP_Entity_Pickup : public ToolsAVP_Entity_PhysicalObject
{
public:

	ToolsAVP_Entity_Pickup( AVP_ServerEntity_Pickup* pxEntity );		
	virtual ~ToolsAVP_Entity_Pickup();

	static void Create();
	static Tools_Object* Create(Asura_Entity* pxEntity);
	static  ToolsAVP_Entity_Pickup* CreateMain( void );

	virtual const char* GetTypeDescription() { return "Pickup Object"; }
    virtual bool HandlesThisMessage(int messageID);

#ifndef TOOLS_USE_OLD_ENTITY_MANAGER
	virtual const char* GetShortName(){return "PICKUP";}
#endif

	virtual void AddOverlayControls(Asura_Overlay* pxOverlay, Asura_Vector_2& xOffset);
	virtual void OnSelection();
	virtual void AddFilesToExportList(List<Asura_String>& xNameList) const;
	virtual void Copy(const Tools_Object* pxObject);	
	virtual Tools_Object* CreateObjectOfThisType() const;
	virtual bool GetEventDescForMessageBlock( unsigned short usMessageBlockID, Asura_String& xOutputDesc );
	virtual bool OwnsThisMessageBlock( unsigned short usMessageBlockID );
	virtual	void Destroy();
private:

	enum
	{
		NUM_PICKUPS_DISPLAYED = 8
	};

	static float GetMaxQuantityFromBlueprints(int iSubTypeIndex);

	static bool IsFixedAmount();
	static bool IsWeapon();
	static bool IsWeaponWithSecondaryFire();
	static bool IsIntelligentAmount();
	static bool CanRespawn();
    static void OnSelectPickupType();
	static void	EditOnPickedUpMessages();
	static void	EditOnDroppedMessages();
	static void ChooseBlueprint();
	static void EditBlueprint();

	void   SetToolsPickupSkin();
	void   GetDialogueBlueprintName(char* pcName, u_int uSize ) const;

	// Loaded objects
	Asura_Hash_ID m_uPickupBlueprintHashBackup;
	Asura_Hash_ID m_uDialogBlueprintHashBackup;
	bool          m_bCanRespawnBackup;
	float         m_fRespawnTimeBackup;
	bool          m_bFixedQuantityBackup;
	u_int         m_uFixedQuantityBackup;
	u_int         m_uIntelligentAmountBackup;    //Scarce, medium, plenty

	static ToolsAVP_Entity_Pickup* s_pxCurrentPickupToolObject;

	typedef ToolsAVP_Entity_PhysicalObject PARENT;
};

//
// CLASS ToolsAVP_Entity_Pickup_DropDownList_Dialog
//
class ToolsAVP_Entity_Pickup_DropDownList_Dialog : public Asura_Hash_DropDownList_Dialog
{
public:

	ToolsAVP_Entity_Pickup_DropDownList_Dialog( const Asura_Vector_2& xOffset, const int iNumberOfLines, Asura_Hash_ID* puSelected, bool* pbChangedFlag, const char* szName);

	virtual u_int GetNumberOfHashValues() const;
	virtual const char* GetNameByIndex(int iIndex) const;

private :

	typedef Asura_Hash_DropDownList_Dialog PARENT;
};

#endif // __TOOLSAVP_ENTITY_PICKUPOBJECT__
