
///////////////////////////////////////////////////////////////////////////////
//
// File   : AVP_Messages_Alien.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_ALIEN_H__
#define __AVP_MESSAGES_ALIEN_H__

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

#include "Entity/PhysicalObject/Moves/Asura_Movement_System.h"

#include "Entity/PhysicalObject/Actor/Vertebrates/AVP_Vertebrate_Messages.h"
#include "Entity/PhysicalObject/Actor/Vertebrates/Alien/AVP_ServerActor_Alien.h"


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

class Asura_NetMsg;
class Asura_BitPacker;
class Asura_BitUnpacker; 
class AVP_ClientActor_Alien;
class AVP_ClientEntity_Actor;

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

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

class AVP_Message_AlienPlayerCommands : public AVP_Message_VertebratePlayerCommands
{
public:
	// Constructor
	AVP_Message_AlienPlayerCommands( const AVP_ClientActor_Alien& xAlien ); 
	AVP_Message_AlienPlayerCommands( Asura_BitUnpacker& xUnpacker ); 

	void FillAlien( const AVP_ClientActor_Alien& xAlien );

	// Accessor functions...
	bool IsStanding() const { return m_bStanding; }
	bool IsRequestingFacehuggerPetChange() const { return m_bFacehuggerPetRequested; }
	bool IsRequestingDistraction() const { return m_bDistractionRequested; }
	bool IsRequestingTailCharge() const { return m_bTailChargeRequested; }

	// Compression 
	void Pack( Asura_BitPacker& xPacker ) const; 
	void Unpack( Asura_BitUnpacker& xUnpacker ); 

protected:
	AVP_Message_AlienPlayerCommands() {}

private:
	typedef AVP_Message_VertebratePlayerCommands PARENT;
	
	bool m_bStanding;
	bool m_bFacehuggerPetRequested;
	bool m_bDistractionRequested;
	bool m_bTailChargeRequested;

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

};

////////////////////////////////////////////////////////////////////////////////
// Class        : AVP_Message_AlienClientUpdate
// Author       : Andy Tate
// Date         : 6-Oct-2006
//
// Description  : Message to handle updating the Aliens client-entity.
////////////////////////////////////////////////////////////////////////////////

class AVP_Message_AlienClientUpdate : public AVP_Message_Vertebrate_ClientUpdate
{
public:
	void FillAlien( const AVP_ServerActor_Alien& xAlien );

	bool IsEnemyInsideGrabRange() const { return m_bInsideGrabRange; }
	bool IsEnemyInsidePounceRange() const { return m_bInsidePounceRange; }
	bool IsEnemyInsideTailAttackRange() const { return m_bInsideTailAttackRange; }
	bool IsStanding() const { return m_bStanding; }
	AVP_Alien_AIAnimStateMachine::LimbDamage GetLimbDamage() const { return m_eLimbDamage; }
	bool IsFaceHuggerSummoningPointAvailable() const { return m_bIsFaceHuggerSummoningPointAvailable; }
	bool IsAlienInShadow() const { return m_bIsAlienInShadow; }
	u_int GetFaceHuggerPetStatus() const { return m_uFaceHuggerPetStatus; }

#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>( 5 + PARENT::GetNumFields() ); }
#endif//#ifdef ASURA_SUPPORT_NETMSG_SYSTEM

protected:
	AVP_Message_AlienClientUpdate() {}

private:
	typedef AVP_Message_Vertebrate_ClientUpdate PARENT;

	bool m_bStanding; 
	bool m_bInsideGrabRange;
	bool m_bInsidePounceRange;
	bool m_bInsideTailAttackRange;
	bool m_bIsFaceHuggerSummoningPointAvailable;
	bool m_bIsAlienInShadow;
	u_int m_uFaceHuggerPetStatus;
	AVP_Alien_AIAnimStateMachine::LimbDamage m_eLimbDamage;

	AVP_Message_AlienClientUpdate( const AVP_Message_AlienClientUpdate& xOther );
	AVP_Message_AlienClientUpdate& operator= ( const AVP_Message_AlienClientUpdate& xOther );
};

////////////////////////////////////////////////////////////////////////////////
// Class        : AVP_Message_Alien_Move_JumpSurfaceStart
// Author       : Andy Tate
// Date         : 5-Sep-2007
//
// Description  : Class to send jump-to-surface start move data.
////////////////////////////////////////////////////////////////////////////////

class AVP_Message_Alien_Move_JumpSurfaceStart : public Asura_Msg_Move
{
public:
    AVP_Message_Alien_Move_JumpSurfaceStart() {}
    ~AVP_Message_Alien_Move_JumpSurfaceStart() {}
    
    void	        SetDestinationNormal(const Asura_Vector_3& xNormal)		    { m_xDestinationNormal = xNormal; }
	void	        GetDestinationNormal(Asura_Vector_3& xNormal) const		    { xNormal = m_xDestinationNormal; }
	void	        SetDestinationPosition(const Asura_Vector_3& xPosition)	    { m_xDestinationPosition = xPosition; }
    void	        GetDestinationPosition(Asura_Vector_3& xPosition) const	    { xPosition = m_xDestinationPosition; }

private:
	Asura_Vector_3	m_xDestinationNormal;
	Asura_Vector_3	m_xDestinationPosition;

	AVP_Message_Alien_Move_JumpSurfaceStart(const AVP_Message_Alien_Move_JumpSurfaceStart& xOther);
};

class AVP_Message_Alien_Move_MountBranch_Start : 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	SetTargetOrientation(const Asura_Quat& xOrientation)	{ m_xTargetOrientation = xOrientation; }
	void	GetTargetOrientation(Asura_Quat& xOrientation) const	{ xOrientation = m_xTargetOrientation; }

protected:
	// Protected variables...

	// Protected functions...

private:
	// Private variables...
	Asura_Vector_3 m_xDestinationPosition;
	Asura_Quat m_xTargetOrientation;
};   // End of class 'AVP_Message_Alien_Move_MountBranch_Start'.


class AVP_Message_Alien_Move_DismountBranch_Start : public Asura_Msg_Move
{
public:
	// Public functions...
	void	SetDirection(const Asura_Vector_3& xDirection)	{ m_xDirection = xDirection; }
	void	GetDirection(Asura_Vector_3& xDirection) const	{ xDirection = m_xDirection; }

protected:
	// Protected variables...

	// Protected functions...

private:
	// Private variables...
	Asura_Vector_3	m_xDirection;
};   // End of class 'AVP_Message_Alien_Move_DismountBranch_Start'.

class AVP_Message_Alien_Move_VentStart : public Asura_Msg_Move
{
public:
	const Asura_Vector_3&	GetBeginPos() const { return m_xBeginPos; }
	const Asura_Quat&		GetBeginOri() const { return m_xBeginOri; }
	const Asura_Vector_3&	GetFinalPos() const { return m_xFinalPos; }
	const Asura_Quat&		GetFinalOri() const { return m_xFinalOri; }
	Asura_Hash_ID			GetBeginAnimHash() const { return m_uBeginAnimHash; }
	Asura_Hash_ID			GetFinalAnimHash() const { return m_uFinalAnimHash; }

	void SetBeginPos( const Asura_Vector_3& xBeginPos ) { m_xBeginPos = xBeginPos; }
	void SetBeginOri( const Asura_Matrix_3x3& xBeginOri ) { m_xBeginOri.FromMatrix(xBeginOri); }
	void SetFinalPos( const Asura_Vector_3& xFinalPos ) { m_xFinalPos = xFinalPos; }
	void SetFinalOri( const Asura_Matrix_3x3& xFinalOri ) { m_xFinalOri.FromMatrix(xFinalOri); }
	void SetBeginAnimHash( Asura_Hash_ID uAnimHash ){ m_uBeginAnimHash = uAnimHash; }
	void SetFinalAnimHash( Asura_Hash_ID uAnimHash ){ m_uFinalAnimHash = uAnimHash; }

private:
	Asura_Vector_3	m_xBeginPos;
	Asura_Quat		m_xBeginOri;
	Asura_Vector_3	m_xFinalPos;
	Asura_Quat		m_xFinalOri;
	Asura_Hash_ID	m_uBeginAnimHash;
	Asura_Hash_ID	m_uFinalAnimHash;
};

class AVP_Message_Alien_AI_Move_VentStart : public Asura_Msg_Move
{
public:
	const Asura_Vector_3&	GetDestPos() const { return m_xDestPos; }
	const Asura_Quat&		GetDestOri() const { return m_xDestOri; }
	Asura_Hash_ID			GetAnimHash() const { return m_uAnimHash; }

	void SetDestPos( const Asura_Vector_3& xPos ) { m_xDestPos = xPos; }
	void SetDestOri( const Asura_Matrix_3x3& xOri ) { m_xDestOri.FromMatrix(xOri); }
	void SetAnimHash( Asura_Hash_ID uAnimHash ){ m_uAnimHash = uAnimHash; }

private:
	Asura_Vector_3	m_xDestPos;
	Asura_Quat		m_xDestOri;
	Asura_Hash_ID	m_uAnimHash;
};

class AVP_Message_Alien_AI_Move_JumpSurfaceStart : public Asura_Msg_Move
{
public:
	AVP_Message_Alien_AI_Move_JumpSurfaceStart() {}
	~AVP_Message_Alien_AI_Move_JumpSurfaceStart() {}

	void SetDestinationOrientation(const Asura_Matrix_3x3 &xOrientation) { m_xDestinationOrientation = xOrientation; }
	void GetDestinationOrientation(Asura_Matrix_3x3 &xOrientation) const { xOrientation = m_xDestinationOrientation; }
	void SetDestinationPosition(const Asura_Vector_3& xPosition) { m_xDestinationPosition = xPosition; }
	void GetDestinationPosition(Asura_Vector_3& xPosition) const { xPosition = m_xDestinationPosition; }
	void SetStartJumpPosition(const Asura_Vector_3& xPosition) { m_xStartJumpPosition = xPosition; }
	void GetStartJumpPosition(Asura_Vector_3& xPosition) const { xPosition = m_xStartJumpPosition; }
	void SetJumpHash(Asura_Hash_ID uJumpHashID) { m_uJumpHashID = uJumpHashID; }
	Asura_Hash_ID GetJumpHash() const { return m_uJumpHashID; }
	void SetJumpAnimHash(Asura_Hash_ID uJumpHashID) { m_uJumpAnimHashID = uJumpHashID; }
	Asura_Hash_ID GetJumpAnimHash() const { return m_uJumpAnimHashID; }

private:
	Asura_Matrix_3x3 m_xDestinationOrientation;
	Asura_Vector_3	m_xDestinationPosition;
	Asura_Vector_3 m_xStartJumpPosition;
	Asura_Hash_ID m_uJumpHashID;
	Asura_Hash_ID m_uJumpAnimHashID;

	AVP_Message_Alien_AI_Move_JumpSurfaceStart(const AVP_Message_Alien_AI_Move_JumpSurfaceStart& xOther);
};

class AVP_Message_Alien_AI_Move_TurnAndJumpSurfaceStart : public AVP_Message_Alien_AI_Move_JumpSurfaceStart
{
public:

	AVP_Message_Alien_AI_Move_TurnAndJumpSurfaceStart() {}
	~AVP_Message_Alien_AI_Move_TurnAndJumpSurfaceStart() {}

	void SetTurnOrientation(const Asura_Matrix_3x3 &xOrientation) { m_xTurnOrientation = xOrientation; }
	void GetTurnOrientation(Asura_Matrix_3x3 &xOrientation) const { xOrientation = m_xTurnOrientation; }

private:

	Asura_Matrix_3x3 m_xTurnOrientation;

	AVP_Message_Alien_AI_Move_TurnAndJumpSurfaceStart(const AVP_Message_Alien_AI_Move_TurnAndJumpSurfaceStart& xOther);
};


class AVP_Message_Alien_AI_Move_TurnStart : public Asura_Msg_Move
{
public:

	AVP_Message_Alien_AI_Move_TurnStart() {}
	~AVP_Message_Alien_AI_Move_TurnStart() {}

	void SetTurnOrientation(const Asura_Matrix_3x3 &xOrientation) { m_xTurnOrientation = xOrientation; }
	void GetTurnOrientation(Asura_Matrix_3x3 &xOrientation) const { xOrientation = m_xTurnOrientation; }

private:

	Asura_Matrix_3x3 m_xTurnOrientation;

	AVP_Message_Alien_AI_Move_TurnStart(const AVP_Message_Alien_AI_Move_TurnStart& xOther);
};

class AVP_Message_Alien_AI_Move_FallStart : public Asura_Msg_Move
{
public:

	AVP_Message_Alien_AI_Move_FallStart() {}
	~AVP_Message_Alien_AI_Move_FallStart() {}

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

private:

	Asura_Matrix_3x3 m_xDestOrientation;

	AVP_Message_Alien_AI_Move_FallStart(const AVP_Message_Alien_AI_Move_FallStart& xOther);
};



#endif   // ifndef __AVP_MESSAGES_ALIEN_H__

