//////////////////////////////////////////////////////////////////////////////
//
// AVP_PlayerObjective_Messages.h
//
// (AJK - 13.10.2008) Created
//
// Copyright (c) 2008 Rebellion. All rights reserved.
//
//////////////////////////////////////////////////////////////////////////////
#ifndef __AVP_MESSAGE_OBJECTIVE_PLAYER_CLIENTCREATE__
#define __AVP_MESSAGE_OBJECTIVE_PLAYER_CLIENTCREATE__

// AVP
#include "Entity/ObjectiveSystem/PlayerObjective/AVP_ServerEntity_PlayerObjective.h"
#include "Entity/ObjectiveSystem/PlayerObjective/AVP_ClientEntity_PlayerObjective.h"

//
// Creation message
//
class AVP_Message_PlayerObjective_ClientCreate
{	
public:

	AVP_Message_PlayerObjective_ClientCreate()
	: m_uPageHash(ASURA_HASH_ID_UNSET)
	, m_uTextHash(ASURA_HASH_ID_UNSET)
    , m_uFlags(0)
	{

	}

	void Fill(const AVP_ServerEntity_PlayerObjective* pxEntity)
	{
		m_uPageHash = pxEntity->GetObjectiveText().GetTextPageHash();
		m_uTextHash = pxEntity->GetObjectiveText().GetTextID();;
		m_uFlags    = pxEntity->GetFlags();
	}

	void Extract(AVP_ClientEntity_PlayerObjective* pxEntity) const
	{
		pxEntity->GetObjectiveText().SetTextPageHash(m_uPageHash);
		pxEntity->GetObjectiveText().SetTextID(m_uTextHash);
	    pxEntity->SetFlags(m_uFlags);
	}

private:

	Asura_Hash_ID m_uPageHash;
	Asura_Hash_ID m_uTextHash;
	u_int         m_uFlags;
};

class AVP_Message_PlayerObjectiveSetMarker
{
public:
	enum { uCURRENT_VERSION };

	u_int      m_uVersion;
	Asura_Guid m_uMarkerGuid;
};

class AVP_Message_PlayerObjectiveSetEntity
{
public:
	enum { uCURRENT_VERSION };

	u_int      m_uVersion;
	Asura_Guid m_uEntityGuid;
};

#endif   // __AVP_MESSAGE_OBJECTIVE_PLAYER_CLIENTCREATE__