//////////////////////////////////////////////////////////////////////////////
//
// AVP_Pickup_Messages.h
//
// (AJK - 29.08.2008) Created
//
// Copyright (c) 2008 Rebellion. All rights reserved.
//
//////////////////////////////////////////////////////////////////////////////
#ifndef __AVP_PICKUP_MESSAGES__
#define __AVP_PICKUP_MESSAGES__

// AVP
#include "Entity/PhysicalObject/AVP_PhysicalObject_Messages.h"

class AVP_ServerEntity_Pickup;
class AVP_ClientEntity_Pickup;

//
// Creation message
//
class AVP_Message_Pickup_ClientCreate: public AVP_Message_PhysicalObject_ClientCreate
{	

public:

	void FillPickup(const AVP_ServerEntity_Pickup*)  ;
	void ExtractPickup(AVP_ClientEntity_Pickup*) const ;

private:

	bool		  m_bHidden;                         //In case of a respawnable pickup that is collected, we hide it the time for respawn time to be over
	bool		  m_bEnabled;
	Asura_Hash_ID m_uPickupBlueprintHash;
	Asura_Hash_ID m_uDialogueBlueprintHash;
	
	int m_iValue;							// holds either the intelligent type or the fixed quantity

	typedef AVP_Message_PhysicalObject_ClientCreate PARENT;
};

//
// Update message
//
class AVP_Message_Pickup_ClientUpdate: public AVP_Message_PhysicalObject_ClientUpdate
{	

public:

	void FillPickup(const AVP_ServerEntity_Pickup*)  ;
	void ExtractPickup(AVP_ClientEntity_Pickup*) const ;

#ifdef ASURA_SUPPORT_NETMSG_SYSTEM
	static void RegisterFields(u_short usMsgID, u_short usEntityClassification);
	static void RegisterFields(class Asura_NetMsg* pxNetMsg);
	static u_char GetNumFields() { return 2 + PARENT::GetNumFields(); }
#endif//#ifdef ASURA_SUPPORT_NETMSG_SYSTEM

private:

	bool m_bHidden;                       //In case of a respawnable pickup that is collected, we hide it the time for respawn time to be over
	bool m_bEnabled;

	typedef AVP_Message_PhysicalObject_ClientUpdate PARENT;
};

//
// Collection message
//
class AVP_Message_Pickup_Collect
{	

public:

	void FillInfo   ( Asura_Guid uPickupGuid, Asura_Hash_ID  uPickupBlueprintHash, int  iQuantity,  bool bSetAsCurrent,  int  iSecondaryQuantity = 0);
	void ExtractInfo( Asura_Guid& uPickupGuid, Asura_Hash_ID& uPickupBlueprintHash, int& iQuantity, bool& bSetAsCurrent, int* piSecondaryQuantity = NULL) const;

private:

	Asura_Guid	  m_uPickupGuid;
	Asura_Hash_ID m_uPickupBlueprintHash;
	int           m_iQuantity;
	int           m_iSecondaryQuantity;
	bool          m_bSetAsCurrent;
};

//
// Request message
//
class AVP_Message_Pickup_RequestCollection
{	

public:

	void FillInfo   ( Asura_Guid  uGuid) { m_uPickupGUID = uGuid; }
	void ExtractInfo( Asura_Guid& uGuid) const { uGuid = m_uPickupGUID; }

private:

	Asura_Guid m_uPickupGUID;
};

#endif // #ifndef __AVP_PICKUP_MESSAGES__
