
///////////////////////////////////////////////////////////////////////////////
//
// File   : AVP_Messages_Human.h
// Author : Chris Wallace
// Date   : 5-Feb-2007
//
// Copyright (C) 2007 Rebellion, All Rights Reserved.
//
///////////////////////////////////////////////////////////////////////////////

#ifdef ASURA_USE_PRAGMA_ONCE
	#pragma once
#endif   // ifdef ASURA_USE_PRAGMA_ONCE

#ifndef __AVP_MESSAGES_HUMAN_H__
#define __AVP_MESSAGES_HUMAN_H__

////////////////////////////////////////////////////////////////////////////////
// Include files...
////////////////////////////////////////////////////////////////////////////////

#include "Entity/PhysicalObject/Actor/Vertebrates/AVP_Vertebrate_Messages.h"
#include "Entity/PhysicalObject/Actor/Vertebrates/Human/AVP_ClientActor_Human.h"
#include "Entity/PhysicalObject/Actor/Vertebrates/Human/AVP_ServerActor_Human.h"
#include "Entity/PhysicalObject/Actor/Vertebrates/Human/Civilian/AVP_ServerActor_Civilian.h"
#include "Inventory/AVP_AmmoStore.h"

////////////////////////////////////////////////////////////////////////////////
// Forward class declarations...
////////////////////////////////////////////////////////////////////////////////

class Asura_NetMsg;
class Asura_BitPacker;
class Asura_BitUnpacker; 
class AVP_ClientActor_Human;


////////////////////////////////////////////////////////////////////////////////
// Class declaration...
////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////
// Class        : AVP_Message_HumanPlayerCommands
// Author       : Andy Tate
// Date         : 11-Oct-2006
//
// Description  : Message to handle the passing of player-Human data from the
//				  client to the server.
////////////////////////////////////////////////////////////////////////////////

class AVP_Message_HumanPlayerCommands : public AVP_Message_VertebratePlayerCommands
{
public:
	// Constructor
	AVP_Message_HumanPlayerCommands( const AVP_ClientActor_Human& xHuman );
	AVP_Message_HumanPlayerCommands( Asura_BitUnpacker& xUnpacker ); 
	
	void FillHuman( const AVP_ClientActor_Human& xHuman );

	// Accessor functions...
	bool IsCrouching() const { return m_bCrouching; }
	bool IsAiming() const { return m_bAiming; }
	
	// Compression
	void Pack( Asura_BitPacker& xPacker ) const; 
	void Unpack( Asura_BitUnpacker& xUnpacker ); 

protected:
	AVP_Message_HumanPlayerCommands() {}

private:
	typedef AVP_Message_VertebratePlayerCommands PARENT;
	
	struct
	{
		bool	m_bCrouching;
		bool	m_bAiming;
	};

	AVP_Message_HumanPlayerCommands( const AVP_Message_HumanPlayerCommands& xOther );
	AVP_Message_HumanPlayerCommands& operator=( const AVP_Message_HumanPlayerCommands& xOther );

};   // End of class 'AVP_Message_HumanPlayerCommands'.



////////////////////////////////////////////////////////////////////////////////
// Class        : AVP_Message_HumanClientUpdate
// Author       : Andy Tate
// Date         : 6-Oct-2006
//
// Description  : Message to handle updating the Humans client-entity.
////////////////////////////////////////////////////////////////////////////////
class AVP_Message_HumanClientUpdate : public AVP_Message_Vertebrate_ClientUpdate
{
public:
	void FillHuman( const AVP_ServerActor_Human& xHuman );

	// Accessor Functions	
	bool		IsCrouching() const		{ return m_bCrouching; }
	bool		IsAiming() const		{ return m_bAiming; }
	
	AVP_Human_AIAnimStateMachine::CoverType GetCoverType() const { return m_eCoverType; }

	u_int		GetAlertLevel() const   { return m_uAlertLevel; }
	
	// NetMsg
#ifdef ASURA_SUPPORT_NETMSG_SYSTEM
	static void RegisterFields( u_short usMsgID, u_short usEntityClassification );
	static void RegisterFields( Asura_NetMsg* pxNetMsg );
	static u_char GetNumFields() { return static_cast<u_char>(4 + PARENT::GetNumFields() ); }
#endif//#ifdef ASURA_SUPPORT_NETMSG_SYSTEM

protected:
	AVP_Message_HumanClientUpdate()	{}
	
private:
	typedef AVP_Message_Vertebrate_ClientUpdate PARENT;

	struct
	{
		bool	m_bCrouching;
		bool	m_bAiming;
	};
	AVP_Human_AIAnimStateMachine::CoverType m_eCoverType;

	u_int   m_uAlertLevel;
	// Private functions...

	AVP_Message_HumanClientUpdate  (const AVP_Message_HumanClientUpdate& xOther);
	AVP_Message_HumanClientUpdate&	operator=	(const AVP_Message_HumanClientUpdate& xOther);

};   // End of class 'AVP_Message_HumanClientUpdate'.

class AVP_Message_PlayDialogueEvent
{
public:

	// Public functions...

	Asura_Hash_ID	GetDialogueHashID( void ) const					{ return m_uDialogueHashID; }
	void			SetDialogueHashID( Asura_Hash_ID uHash )		{ m_uDialogueHashID = uHash; }

protected:
	// Protected variables...

	// Protected functions...

private:
	// Private variables...

	Asura_Hash_ID	m_uDialogueHashID;

	// Private functions...

	AVP_Message_PlayDialogueEvent  (void);
	AVP_Message_PlayDialogueEvent  (const AVP_Message_PlayDialogueEvent& xOther);
	~AVP_Message_PlayDialogueEvent ();

	AVP_Message_PlayDialogueEvent&	operator=	(const AVP_Message_PlayDialogueEvent& xOther);

};   // End of class 'AVP_Message_PlayDialogueEvent'.

//----------------------------------------------------------------------------
// Class 'AVP_Message_Human_EnterCover'
//----------------------------------------------------------------------------
class AVP_Message_Human_EnterCover : public Asura_Msg_Move
{
public:
	// Public functions...
	void			SetDestinationPosition( const Asura_Vector_3& xPosition )			{ m_xDestinationPosition = xPosition; }
	void			GetDestinationPosition( Asura_Vector_3& xPosition ) const			{ xPosition = m_xDestinationPosition; }

	void			SetDestinationOrientation( const Asura_Matrix_3x3& xOrientation )	{ m_xDestiantionOrientation = xOrientation; }
	void			GetDestinationOrientation( Asura_Matrix_3x3& xOrientation )	const	{ xOrientation = m_xDestiantionOrientation; }

	void			SetAnimationHash( Asura_Hash_ID uAnimationHash )					{ m_uAnimationHash = uAnimationHash; }
	Asura_Hash_ID	GetAnimationHash( void ) const										{ return m_uAnimationHash; }

private:
	// Private variables...
	Asura_Vector_3		m_xDestinationPosition;
	Asura_Matrix_3x3	m_xDestiantionOrientation;
	Asura_Hash_ID		m_uAnimationHash;

};
//----------------------------------------------------------------------------
// End of class 'AVP_Message_Human_EnterCover'.
//----------------------------------------------------------------------------

//----------------------------------------------------------------------------
// Class 'AVP_Message_Human_PeekEmerge'
//----------------------------------------------------------------------------
class AVP_Message_Human_PeekEmerge : public Asura_Msg_Move
{
public:

	void			SetIntoPeekAnimationHash( Asura_Hash_ID uAnimationHash )		{ m_uIntoPeekAnimationHash = uAnimationHash; }
	Asura_Hash_ID	GetIntoPeekAnimationHash( void ) const							{ return m_uIntoPeekAnimationHash; }

	void			SetPeekAnimationHash( Asura_Hash_ID uAnimationHash )			{ m_uPeekAnimationHash = uAnimationHash; }
	Asura_Hash_ID	GetPeekAnimationHash( void ) const								{ return m_uPeekAnimationHash; }

private:
	// Private variables...
	Asura_Hash_ID		m_uIntoPeekAnimationHash;
	Asura_Hash_ID		m_uPeekAnimationHash;

};
//----------------------------------------------------------------------------
// End of class 'AVP_Message_Human_EnterCover'.
//----------------------------------------------------------------------------

//----------------------------------------------------------------------------
// Class 'AVP_Message_Human_StepOutOfCover'
//----------------------------------------------------------------------------
class AVP_Message_Human_StepOutOfCover : public Asura_Msg_Move
{
public:

	void			SetStepOutAnimHash( Asura_Hash_ID uStepOutAnimHash )			{ m_uStepOutAnimHash = uStepOutAnimHash; }
	Asura_Hash_ID	GetStepOutAnimHash( void ) const								{ return m_uStepOutAnimHash; }


private:

	// Private variables...
	Asura_Hash_ID m_uStepOutAnimHash;
};
//----------------------------------------------------------------------------
// End of class 'AVP_Message_Human_StepOutOfCover'.
//----------------------------------------------------------------------------

//----------------------------------------------------------------------------
// Class 'AVP_Message_Human_StepOutOfCover'
//----------------------------------------------------------------------------
class AVP_Message_Human_MountGamescene : public Asura_Msg_Move
{

public:
	// Public functions...
	void			SetDestinationPosition( const Asura_Vector_3& xPosition )			{ m_xDestinationPosition = xPosition; }
	void			GetDestinationPosition( Asura_Vector_3& xPosition ) const			{ xPosition = m_xDestinationPosition; }

	void			SetDestinationOrientation( const Asura_Matrix_3x3& xOrientation )	{ m_xDestiantionOrientation = xOrientation; }
	void			GetDestinationOrientation( Asura_Matrix_3x3& xOrientation )	const	{ xOrientation = m_xDestiantionOrientation; }

	void			SetAnimBlendTemplateBlueprintHash( Asura_Hash_ID uBPHash )			{ m_uAnimBlendTemplateBlueprintHash = uBPHash; }
	Asura_Hash_ID	GetAnimBlendTemplateBlueprintHash( void ) const						{ return m_uAnimBlendTemplateBlueprintHash; }

private:
	// Private variables...
	Asura_Vector_3		m_xDestinationPosition;
	Asura_Matrix_3x3	m_xDestiantionOrientation;
	Asura_Hash_ID		m_uAnimBlendTemplateBlueprintHash;

};
//----------------------------------------------------------------------------
// End of class 'AVP_Message_Human_StepOutOfCover'.
//----------------------------------------------------------------------------

class AVP_Message_SetGS2MoveSpeed
{
public:

	void Initialise()
	{
		m_uVersion		= 1;
		m_uMoveSpeed	= 0;
	}

	u_int m_uVersion;
	u_int m_uMoveSpeed;
};

class AVP_Message_Human_MoveToFloor : public Asura_Msg_Move
{
public:

	Asura_Hash_ID		m_uAnimHash;
	Asura_Vector_3		m_xDirection;

};

#endif   // ifndef __AVP_MESSAGES_HUMAN_H__


/// End of file. ///
