
///////////////////////////////////////////////////////////////////////////////
//
// File   : AVP_Actor_Messages.h
// Author : Andy Tate
// Date   : 11-Oct-2006
//
// Copyright (C) 2006 Rebellion, All Rights Reserved.
//
///////////////////////////////////////////////////////////////////////////////

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

#ifndef __AVP_ACTOR_MESSAGES_H__
#define __AVP_ACTOR_MESSAGES_H__

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

// asura
#include "Core/Asura_Maths.h"
#include "Entity/PhysicalObject/AVP_PhysicalObject_Messages.h"
#include "Entity/PhysicalObject/Moves/Asura_Movement_System.h"

// axon
#include "AnimTemplates/Axon_Gamescene_AnimSequenceData.h"

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

class Asura_NetMsg;
class Asura_BitPacker;
class Asura_BitUnpacker; 
class AVP_ClientEntity_Actor;
class AVP_ServerEntity_Actor;

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

class AVP_Message_Actor_ClientUpdate : public AVP_Message_PhysicalObject_ClientUpdate
{
public:
    void FillActor( const AVP_ServerEntity_Actor& xActor );

	const Axon_Gamescene_AnimSequenceData& GetAnimSequenceData() const { return m_xAnimSequenceData; }

	const Asura_Vector_3&	GetAimDirection()			const { return m_xAimDirection; }
	const Asura_Vector_3&	GetLookAtPosition()			const { return m_xLookAtPosition; }
	const Asura_Vector_3&	GetMovementDirection()		const { return m_xMovementDirection; }

    u_int			GetCurrentAnim()					const { return m_ucCurrentAnim; }
    u_int			GetLoopData()   					const { return m_ucLoopData; }
    bool			ShouldTween()   					const { return m_bShouldTween; }

	u_int			GetGroundType()						const { return m_eGroundType; }
	bool			IsPlayer()							const { return m_bIsPlayer; }
	bool			IsMoving()							const { return m_bMoving; }
	bool			IsMovingSlow()						const { return m_bMovingSlow; }
	bool			IsMovingFast()						const { return m_bMovingFast; }
	bool			IsDestructible()					const { return m_bIsDestructible; }
	bool			IsADeadBody()						const { return m_bDeadBody; }
	bool			IsClientPosAndOriTimeValid()		const { return m_bClientPosAndOriTimeValid; }


    Asura_Guid		GetActorGuidImAttacking(void)		const { return m_uActorGuidImAttacking; }
    Asura_Guid		GetPlayerInfoGuid(void)				const { return m_uPlayerInfoGuid; }

    Asura_Hash_ID   GetCurrentWeaponHash()				const { return m_uCurrentWeaponHash; }
	Asura_Hash_ID   GetDeadAnimHash()					const { return m_uDeadAnimHash; }


	u_int			GetAIAnimState()					const { return m_uAIAnimState; }
	u_int			GetAIAnimStateAfterMove()			const { return m_uAIAnimStateAfterMove; }
	float			GetAIStateAnimTweenTime()			const { return m_fAIStateAnimTweenTime; }
	float			GetTimeInAIAnimState()				const { return m_fTimeInAIAnimState; }
	bool			IsAIStateAnimSync()					const { return m_bAIStateAnimSync; }
	bool			IsAIAnimStateLooped()				const { return m_bAIAnimStateLooped; }

	float			GetPlayerSpeedParameter()			const	{ return m_fPlayerSpeedParameter; }
	float			GetPlayerMoveAngle()				const	{ return m_fPlayerMoveAngle; }
	
	float			GetClientPosAndOriTime()			const { return m_fClientPosAndOriTime; }

#ifdef ASURA_SUPPORT_NETMSG_SYSTEM
	// No way to create this class directly, so no need to register this entity type.
	static void RegisterFields(Asura_NetMsg* pxNetMsg);
	static u_char GetNumFields() { return static_cast<u_char>(24 + Axon_Gamescene_AnimSequenceData::GetNumFields() + AVP_Message_PhysicalObject_ClientUpdate::GetNumFields()); }
#endif//#ifdef ASURA_SUPPORT_NETMSG_SYSTEM

protected:
    Axon_Gamescene_AnimSequenceData m_xAnimSequenceData;

	Asura_Vector_3	m_xAimDirection;	// Worldspace aim direction
	Asura_Vector_3	m_xLookAtPosition;	// Worldspace look at position
	Asura_Vector_3	m_xMovementDirection;

	//## This can be removed if we're using the animation state machine for all of an AI's animation.
    struct 
    {
        u_char		m_ucCurrentAnim;
		u_char		m_ucLoopData;
        bool		m_bShouldTween;
    };

	struct
	{
		u_char		m_eGroundType;			// Flag to say whether this actor is on the ground.
		bool		m_bIsPlayer;			// Flag to say if we are a player
		bool		m_bAIStateAnimSync;
		bool		m_bAIAnimStateLooped;
		bool		m_bMoving;
		bool		m_bMovingSlow;
		bool		m_bMovingFast;
		bool		m_bIsDestructible;
		bool        m_bDeadBody;
		bool		m_bClientPosAndOriTimeValid;
	};

	Asura_Guid		m_uActorGuidImAttacking;
	Asura_Guid		m_uPlayerInfoGuid;
	Asura_Hash_ID	m_uCurrentWeaponHash;
	Asura_Hash_ID	m_uDeadAnimHash;

	u_int			m_uAIAnimState;
	u_int			m_uAIAnimStateAfterMove;
	float			m_fAIStateAnimTweenTime;
	float			m_fTimeInAIAnimState;

	float			m_fPlayerSpeedParameter;
	float			m_fPlayerMoveAngle;

	float			m_fClientPosAndOriTime;	// client pos and ori forwarded from each client to other machines.

};

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

class AVP_Message_ActorPlayerCommands
{
public:
	// Public functions...
	void FillActor( const AVP_ClientEntity_Actor& xActor );

	// Accessor functions...
	const Asura_Vector_3&	GetAimDirection		(void) const	{ return m_xAimDirection; }
	const Asura_Vector_3&	GetLookAtPosition	(void) const	{ return m_xLookAtPosition; }
	const Asura_Vector_3&	GetVelocity			(void) const	{ return m_xVelocity; }
	const Asura_Vector_3&	GetPosition			(void) const	{ return m_xPosition; }
	const Asura_Quat&		GetOrientation		(void) const	{ return m_xOrientation; }

	bool					IsMoving()					const { return m_bMoving; }
	bool					IsMovingSlow()				const { return m_bMovingSlow; }
	bool					IsMovingFast()				const { return m_bMovingFast; }

	Asura_Hash_ID			GetCurrentWeaponHash(void) const	{ return m_uCurrentWeaponHash; }

	float					GetSpeedParameter	(void) const	{ return m_fSpeedParameter; }
	float					GetMoveAngle		(void) const	{ return m_fMoveAngle; }

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

protected:
	AVP_Message_ActorPlayerCommands() {}

private:
	// Private variables...
	Asura_Vector_3	m_xAimDirection;
	Asura_Vector_3	m_xLookAtPosition;

	Asura_Vector_3	m_xVelocity;
	Asura_Vector_3	m_xPosition;
	Asura_Quat		m_xOrientation;

	bool		m_bMoving;
	bool		m_bMovingSlow;
	bool		m_bMovingFast;

	Asura_Hash_ID	m_uCurrentWeaponHash;

	float			m_fSpeedParameter;
	float			m_fMoveAngle;

	// Private functions...
	AVP_Message_ActorPlayerCommands( const AVP_Message_ActorPlayerCommands& xOther );
	AVP_Message_ActorPlayerCommands&  operator=( const AVP_Message_ActorPlayerCommands& xOther );

};   // End of class 'AVP_Message_ActorPlayerCommands'.



////////////////////////////////////////////////////////////////////////////////
// Class        : AVP_Message_ActorLaunchProjectile
// Author       : Andy Tate
// Date         : 31-Oct-2006
//
// Description  : Class to request the actor's specified projectile to be launched.
////////////////////////////////////////////////////////////////////////////////

class AVP_Message_ActorLaunchProjectile
{
public:
	// Public functions...
	void					SetClassification	(const unsigned short uClassification)	{ m_uClassification = uClassification; }
	unsigned short 			GetClassification	(void) const							{ return(m_uClassification); }

	void					SetGuid				(const Asura_Guid uGuid)				{ m_uGuid = uGuid; }
	Asura_Guid				GetGuid				(void) const							{ return(m_uGuid); }

	void					SetPosition			(const Asura_Vector_3& xPosition)		{ m_xPosition = xPosition; }
	const Asura_Vector_3&	GetPosition			(void) const							{ return(m_xPosition); }

	void					SetOrientation		(const Asura_Quat& xOrientation)		{ m_xOrientation = xOrientation; }
	const Asura_Quat&		GetOrientation		(void) const							{ return(m_xOrientation); }

	void					SetVelocity			(const Asura_Vector_3& xVelocity)		{ m_xVelocity = xVelocity; }
	const Asura_Vector_3&	GetVelocity			(void) const							{ return(m_xVelocity); }

	void					SetDamageMultiplier	(const float fMultiplier)				{ m_fDamageMultiplier = fMultiplier; }
	float					GetDamageMultiplier	(void) const							{ return(m_fDamageMultiplier); }

	void					SetSticky			(const bool bSticky)					{ m_uSticky = bSticky ? 1 : 0; }
	bool					GetSticky			(void) const							{ return(m_uSticky); }

	void					SetVisibleToAliens	(const bool bVisible)					{ m_uVisibleToAliens = bVisible ? 1 : 0; }
	bool					GetVisibleToAliens	(void) const							{ return(m_uVisibleToAliens); }


protected:
	// Protected variables...

	// Protected functions...


private:
	// Private variables...
	unsigned short	m_uClassification;
	Asura_Guid		m_uGuid;
	Asura_Vector_3	m_xPosition;
	Asura_Quat		m_xOrientation;
	Asura_Vector_3	m_xVelocity;
	float			m_fDamageMultiplier;

	union
	{
		u_int	m_uFlags;
		struct 
		{
			u_int	m_uSticky			: 1;		// Sticks to targets?
			u_int	m_uVisibleToAliens	: 1;		// Visible to aliens?
		};
	};

	// Private functions...
	AVP_Message_ActorLaunchProjectile  (void);
	AVP_Message_ActorLaunchProjectile  (const AVP_Message_ActorLaunchProjectile& xOther);
	~AVP_Message_ActorLaunchProjectile ();

	AVP_Message_ActorLaunchProjectile&	operator=	(const AVP_Message_ActorLaunchProjectile& xOther);

};   // End of class 'AVP_Message_ActorLaunchProjectile'.


////////////////////////////////////////////////////////////////////////////////
// Class        : AVP_Message_ActorDisarmProjectile
// Author       : Ste Butcher
// Date         : 11-May-2007
//
// Description  : Class to request the actor's specified projectile to be disarmed.
////////////////////////////////////////////////////////////////////////////////

class AVP_Message_ActorDisarmProjectile
{
public:
	// Public functions...
	void			SetClassification(const unsigned short uClassification)		{ m_uClassification = uClassification; }
	unsigned short 	GetClassification(void) const								{ return m_uClassification; }

	void			SetGuid(const Asura_Guid uGuid)								{ m_uGuid = uGuid; }
	Asura_Guid		GetGuid(void) const											{ return m_uGuid; }

protected:
	// Protected variables...

	// Protected functions...


private:
	// Private variables...
	unsigned short	m_uClassification;
	Asura_Guid		m_uGuid;

	// Private functions...
	AVP_Message_ActorDisarmProjectile  (void);
	AVP_Message_ActorDisarmProjectile  (const AVP_Message_ActorDisarmProjectile& xOther);
	~AVP_Message_ActorDisarmProjectile ();

	AVP_Message_ActorDisarmProjectile&	operator=	(const AVP_Message_ActorDisarmProjectile& xOther);

};   // End of class 'AVP_Message_ActorDisarmProjectile'.




////////////////////////////////////////////////////////////////////////////////
// Class        : AVP_Message_ActorCreateProjectile
// Author       : Chris Wallace
// Date         : 13-Nov-2006
//
// Description  : Class to create and launch a new projectile
////////////////////////////////////////////////////////////////////////////////

class AVP_Message_ActorCreateProjectile
{
public:
	enum
	{
		PROJECTILE_SMALL,
		PROJECTILE_LARGE

		// If you add to this you will need to ensure the flag m_uSize (below) is large enough to cope with your additions.
	};

	// Public functions...
	void					SetOwnerGuid(const Asura_Guid uGuid)						{ m_uOwnerGuid = uGuid; }
	Asura_Guid				GetOwnerGuid(void) const									{ return(m_uOwnerGuid); }

	void					SetClassification	(const unsigned short uClassification)	{ m_uClassification = uClassification; }
	unsigned short 			GetClassification	(void) const							{ return(m_uClassification); }

	void					SetPosition			(const Asura_Vector_3& xPosition)		{ m_xPosition = xPosition; }
	const Asura_Vector_3&	GetPosition			(void) const							{ return(m_xPosition); }

	void					SetOrientation		(const Asura_Quat& xOrientation)		{ m_xOrientation = xOrientation; }
	const Asura_Quat&		GetOrientation		(void) const							{ return(m_xOrientation); }

	void					SetVelocity			(const Asura_Vector_3& xVelocity)		{ m_xVelocity = xVelocity; }
	const Asura_Vector_3&	GetVelocity			(void) const							{ return(m_xVelocity); }

	void					SetDamageScale		(const float fDamageScale)				{ m_fDamageScale = fDamageScale; }
	void					SetMaxDamage		(const float fMaxDamage)				{ m_fMaxDamage = fMaxDamage; }
	void					SetMinDamageRadius	(const float fMinDamageRadius)			{ m_fMinDamageRadius = fMinDamageRadius; }
	void					SetMaxDamageRadius	(const float fMaxDamageRadius)			{ m_fMaxDamageRadius = fMaxDamageRadius; }
	void					SetDamageImpulse	(const float fDamageImpulse)			{ m_fDamageImpulse = fDamageImpulse; }
	void					SetGravityScale		(const float fGravityScale)				{ m_fGravityScale = fGravityScale; }


	float					GetDamageScale		(void) const							{ return(m_fDamageScale); }
	float					GetMaxDamage		(void) const							{ return(m_fMaxDamage); }
	float					GetMinDamageRadius	(void) const							{ return(m_fMinDamageRadius); }
	float					GetMaxDamageRadius	(void) const							{ return(m_fMaxDamageRadius); }
	float					GetDamageImpulse	(void) const							{ return(m_fDamageImpulse); }
	float					GetGravityScale		(void) const							{ return(m_fGravityScale); }

	void					SetLinkMarkerPointID(const Asura_Hash_ID uID)				{ m_uLinkMarkerID = uID; }
	Asura_Hash_ID			GetLinkMarkerPointID(void) const							{ return(m_uLinkMarkerID); }

	void					SetProjectileSize	(const u_int uSize)						{ m_uSize = uSize; }
	u_int					GetProjectileSize	(void) const							{ return(m_uSize); }

protected:
	// Protected variables...

	// Protected functions...


private:
	// Private variables...
	Asura_Guid		m_uOwnerGuid;

	unsigned short	m_uClassification;
	Asura_Vector_3	m_xPosition;
	Asura_Quat		m_xOrientation;
	Asura_Vector_3	m_xVelocity;
	Asura_Hash_ID	m_uLinkMarkerID;

	float			m_fDamageScale;
	float			m_fMaxDamage;
	float			m_fMaxDamageRadius;
	float			m_fMinDamageRadius;
	float			m_fDamageImpulse;
	float			m_fGravityScale;

	union
	{
		u_int	m_uFlags;
		struct 
		{
			u_int	m_uSize				: 1;		// Currently either 0 or 1 (PROJECTILE_SMALL or PROJECTILE_LARGE);
		};
	};

	// Private functions...
	AVP_Message_ActorCreateProjectile  (void);
	AVP_Message_ActorCreateProjectile  (const AVP_Message_ActorCreateProjectile& xOther);
	~AVP_Message_ActorCreateProjectile ();

	AVP_Message_ActorCreateProjectile&	operator=	(const AVP_Message_ActorCreateProjectile& xOther);

};   // End of class 'AVP_Message_ActorCreateProjectile'.





////////////////////////////////////////////////////////////////////////////////
// Class        : AVP_Message_ActorClientPickup
// Author       : Andy Tate
// Date         : 2-Nov-2006
//
// Description  : Class to handle an actor picking up another entity.
////////////////////////////////////////////////////////////////////////////////

class AVP_Message_ActorClientPickup
{
public:
	// Public functions...
	void		SetPickupGuid	(const Asura_Guid uGuid)	{ m_uPickupGuid = uGuid; }
	Asura_Guid	GetPickupGuid	(void) const				{ return(m_uPickupGuid); }


protected:
	// Protected variables...

	// Protected functions...


private:
	// Private variables...
	Asura_Guid	m_uPickupGuid;		// The GUID we're to pick-up.

	// Private functions...
	AVP_Message_ActorClientPickup  (void);
	AVP_Message_ActorClientPickup  (const AVP_Message_ActorClientPickup& xOther);
	~AVP_Message_ActorClientPickup ();

	AVP_Message_ActorClientPickup&	operator=	(const AVP_Message_ActorClientPickup& xOther);

};   // End of class 'AVP_Message_ActorClientPickup'.

////////////////////////////////////////////////////////////////////////////////
// Class        : AVP_Message_ActorClientPickup_Disc
// Author       : Chris Wallace
// Date         : 7-Dec-2007
//
// Description  : Class to handle an actor picking up a disc
////////////////////////////////////////////////////////////////////////////////

class AVP_Message_ActorClientPickup_Disc : public AVP_Message_ActorClientPickup
{
public:
	// Public functions...
	void	SetFromRespawn	(const bool bRespawn)	{ m_bFromRespawn = bRespawn; }
	bool	GetFromRespawn	(void) const				{ return(m_bFromRespawn); }


protected:
	// Protected variables...

	// Protected functions...

private:
	// Private variables...
	bool	m_bFromRespawn;		// has this been 'destroyed'? (and therefore returning to player)

	// Private functions...
	AVP_Message_ActorClientPickup_Disc  (void);
	AVP_Message_ActorClientPickup_Disc  (const AVP_Message_ActorClientPickup_Disc& xOther);
	~AVP_Message_ActorClientPickup_Disc ();

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

////////////////////////////////////////////////////////////////////////////////
// Class        : AVP_Message_Actor_RequestInteraction
// Author       : Andy Tate
// Date         : 2-Nov-2006
//
// Description  : Class to handle the requesting of entity interaction.
////////////////////////////////////////////////////////////////////////////////

class AVP_Message_Actor_RequestInteraction
{
public:
	// Public functions...
	enum Interaction
	{
		INTERACTION_LEFT,
		INTERACTION_RIGHT,
		INTERACTION_FORWARD,
		INTERACTION_BACKWARD,
		INTERACTION_INTIATED,
		INTERACTION_NONE
	};
	void	SetInteractionType(u_int uType)	{ m_uInteractionType = uType; }
	u_int	GetInteractionType() const		{ return m_uInteractionType; }

	void SetActorGuid( Asura_Guid uGuid )	{ m_uActorGuid = uGuid; }
	Asura_Guid	GetActorGuid() const		{ return m_uActorGuid; }

	void	SetIsOn( bool bOn )				{ m_bOn = bOn; }
	bool	IsOn() const					{ return m_bOn; }

	void SetInteractionMoveType( int iInteraction )	{ m_iInteractionMoveType = iInteraction; }
	int	GetInteractionMoveType() const	{ return m_iInteractionMoveType; }

	void SetMoveHash( Asura_Hash_ID uMoveHash )	{ m_uMoveHash = uMoveHash; }
	Asura_Hash_ID	GetMoveHash() const		{ return m_uMoveHash; }

	void  SetData( u_int uData ){ m_uData = uData; }
	u_int GetData() const		{ return m_uData; }

private:
	// Private variables...
	u_int		  m_uInteractionType;
	Asura_Guid	  m_uActorGuid;
	Asura_Hash_ID m_uMoveHash;
	int           m_iInteractionMoveType;
	bool		  m_bOn;
	u_int         m_uData;
};   // End of class 'AVP_Message_Actor_RequestInteraction'.

////////////////////////////////////////////////////////////////////////////////
// Class        : AVP_Message_Actor_UseWeapon
// Author       : Andy Tate
// Date         : 2-Nov-2006
//
// Description  : Class to handle the requesting of entity interaction.
////////////////////////////////////////////////////////////////////////////////

class AVP_Message_Actor_UseWeapon
{
public:
	// Public functions...
	void		SetUseWeapon (bool uUse)				{ m_bUseWeapon = uUse; }
	bool		GetUseWeapon (void) const				{ return(m_bUseWeapon); }

protected:
	// Protected variables...

	// Protected functions...

private:
	// Private variables...
		bool		m_bUseWeapon;

	// Private functions...
	AVP_Message_Actor_UseWeapon  (void);
	AVP_Message_Actor_UseWeapon  (const AVP_Message_Actor_UseWeapon& xOther);
	~AVP_Message_Actor_UseWeapon ();

	AVP_Message_Actor_UseWeapon&	operator=	(const AVP_Message_Actor_UseWeapon& xOther);

};   // End of class 'AVP_Message_Actor_UseWeapon'.

////////////////////////////////////////////////////////////////////////////////
// Class        : AVP_Message_Actor_Interaction_DetonateProjectiles
// Author       : Ste Butcher
// Date         : 30-Apr-2007
//
// Description  : Class to detonate all projectiles of a type owned by a certain owner
////////////////////////////////////////////////////////////////////////////////

class AVP_Message_Actor_Interaction_DetonateProjectiles : public AVP_Message_Actor_RequestInteraction
{
public:

	// Public variables...
	void					SetClassification	(const unsigned short uClassification)		{ m_uClassification = uClassification; }
	unsigned short 			GetClassification	(void) const								{ return(m_uClassification); }

	void					SetOwner			(const Asura_Guid uOwner)					{ m_uOwner = uOwner; }
	Asura_Guid				GetOwner			(void) const								{ return(m_uOwner); }

	void					SetIgnore			(const Asura_Guid uIgnoreGuid)				{ m_uIgnore = uIgnoreGuid; }
	Asura_Guid				GetIgnore			(void) const								{ return(m_uIgnore); }

protected:
	// Protected variables...

private:
	// Private variables...
	unsigned short	m_uClassification;
	Asura_Guid		m_uOwner;
	Asura_Guid		m_uIgnore;


	// Private functions...
	AVP_Message_Actor_Interaction_DetonateProjectiles	(void);
	AVP_Message_Actor_Interaction_DetonateProjectiles	(const AVP_Message_Actor_Interaction_DetonateProjectiles& xOther);
	~AVP_Message_Actor_Interaction_DetonateProjectiles	();

	AVP_Message_Actor_Interaction_DetonateProjectiles&	operator=	(const AVP_Message_Actor_Interaction_DetonateProjectiles& xOther);

};	// End of class 'AVP_Message_Actor_Interaction_DetonateProjectiles'.



////////////////////////////////////////////////////////////////////////////////
// Class        : AVP_Message_ActorCreateProjectile
// Author       : Chris Wallace
// Date         : 13-Nov-2006
//
// Description  : Class to create and launch a new projectile
////////////////////////////////////////////////////////////////////////////////

class AVP_Message_Actor_CreateGib
{
public:
	// Public functions...
	void					SetClassification	(const unsigned short uClassification)		{ m_uClassification = uClassification; }
	unsigned short 			GetClassification	(void) const					{ return(m_uClassification); }

	void					SetPosition		(const Asura_Vector_3& xPosition)	{ m_xPosition = xPosition; }
	const Asura_Vector_3&	GetPosition		(void) const						{ return(m_xPosition); }

	void					SetOrientation	(const Asura_Quat& xOrientation)	{ m_xOrientation = xOrientation; }
	const Asura_Quat&		GetOrientation	(void) const						{ return(m_xOrientation); }

	void					SetDirection	(const Asura_Vector_3& xDirection)	{ m_xDirection = xDirection; }
	const Asura_Vector_3&	GetDirection	(void) const						{ return(m_xDirection); }

	void					SetStrength		(const float& fStrength)			{ m_fStrength = fStrength; }
	const float&			GetStrength		(void) const						{ return(m_fStrength); }

	void					SetElement		(const u_int& uElement)				{ m_uElement = uElement; }
	const u_int&			GetElement		(void) const						{ return(m_uElement); }

protected:
	// Protected variables...

	// Protected functions...

private:
	// Private variables...
	unsigned short	m_uClassification;
	Asura_Vector_3	m_xPosition;
	Asura_Quat		m_xOrientation;
	float			m_fStrength;
	Asura_Vector_3	m_xDirection;
	u_int			m_uElement;

	// Private functions...
	/*
	AVP_Message_ActorCreateProjectile  (void);
	AVP_Message_ActorCreateProjectile  (const AVP_Message_ActorCreateProjectile& xOther);
	~AVP_Message_ActorCreateProjectile ();

	AVP_Message_ActorCreateProjectile&	operator=	(const AVP_Message_ActorCreateProjectile& xOther);
	*/
};   // End of class 'AVP_Message_Actor_CreateGib'.


//////////////////////////////////////////////////////////////////////////////
//
// AVP_Message_Actor_RequestAnimation
//
//////////////////////////////////////////////////////////////////////////////

struct AVP_Message_Actor_RequestAnimation
{
    AVP_Message_Actor_RequestAnimation() : m_uAnimation( 0 ), m_eLoopStatus( LOOP_STATUS_UNSET ), m_bShouldTween( true ) {}

	u_int m_uAnimation;
    enum LoopStatus
    {
        LOOP_STATUS_UNSET,
        LOOP_ON,
        LOOP_OFF
    } m_eLoopStatus;
    bool m_bShouldTween;

	AVP_Message_Actor_RequestAnimation(u_int uAnimId, LoopStatus eLoopStatus) : m_uAnimation( uAnimId ), m_eLoopStatus( eLoopStatus ), m_bShouldTween( true ) {}
};


////////////////////////////////////////////////////////////////////////////////
// Class        : AVP_Message_ChunkActor
// Author       : Chris Wallace
// Date         : 16-July-2007
//
// Description  : Applies severe damage to chosen limb
////////////////////////////////////////////////////////////////////////////////

class AVP_Message_ChunkActor
{
public:
	// Public functions...
	void		SetElement (int uElement)		{ m_iElement = uElement; }
	int			GetElement (void) const			{ return(m_iElement); }

	void		SetDamage (float fDamage)		{ m_fDamage = fDamage; }
	float		GetDamage (void) const			{ return(m_fDamage); }

	int		m_iElement;
	float	m_fDamage;
protected:
	// Protected variables...

	// Protected functions...

private:
	// Private variables...
	

	// Private functions...
	AVP_Message_ChunkActor  (void);
	AVP_Message_ChunkActor  (const AVP_Message_ChunkActor& xOther);
	~AVP_Message_ChunkActor ();

	AVP_Message_ChunkActor&	operator=	(const AVP_Message_ChunkActor& xOther);

};   // End of class 'AVP_Message_Actor_UseWeapon'.


////////////////////////////////////////////////////////////////////////////////
// Class        : AVP_Msg_Dismember
// Author       : Anthony Gregson
// Date         : 20/03/08
//
// Description  : A more thorough (and more sensibly handled) version of the chunk actor message, allowing us to apply impulses to each lump created.
////////////////////////////////////////////////////////////////////////////////

class AVP_Msg_Dismember
{
public:
	void SetElement(int iElement)	{ m_iElement = iElement; }	// which limb is affected
	int GetElement() const			{ return m_iElement ; }

	void SetDamagePosition(const Asura_Vector_3& xPosition)	{ m_xDamagePosition = xPosition; }
	const Asura_Vector_3& GetDamagePosition() const			{ return m_xDamagePosition; }

	void SetRagdollDirection(const Asura_Vector_3& xDirection)	{ m_xRagdollDirection = xDirection; }
	const Asura_Vector_3& GetRagdollDirection() const			{ return m_xRagdollDirection; }

	void SetRagdollImpulse(float fImpulse)	{ m_fRagdollImpulse = fImpulse; }
	float GetRagdollImpulse() const			{ return m_fRagdollImpulse; }

	void SetGibDirection(const Asura_Vector_3& xDirection)	{ m_xGibDirection = xDirection; }
	const Asura_Vector_3& GetGibDirection() const			{ return m_xGibDirection; }

	void SetGibImpulse(float fImpulse)	{ m_fGibImpulse = fImpulse; }
	float GetGibImpulse() const			{ return m_fGibImpulse; }

	void SetDamage(float fDamage)	{ m_fDamage = fDamage; }
	float GetDamage() const			{ return m_fDamage; }

	void SetFromGuid(Asura_Guid uFromGuid)	{ m_uFromGuid = uFromGuid; }
	Asura_Guid GetFromGuid() const			{ return m_uFromGuid; }


	void Initialise()
	{
		m_uVersion  = uCURRENT_VERSION;
	}


protected:
	u_int m_uVersion;

	int m_iElement;
	Asura_Vector_3 m_xDamagePosition;
	// This will be what's created by the normal ragdoll creation
	Asura_Vector_3 m_xRagdollDirection;
	float m_fRagdollImpulse;
	// And this will be what's created by the severe damage to element function.
	// Pass in a direction of 0 to cause the gib not to be created.
	Asura_Vector_3 m_xGibDirection;
	float m_fGibImpulse;
	// Use a negative damage value to kill the enemy automatically.
	float m_fDamage;
	// Source of the dismember message
	Asura_Guid m_uFromGuid; 

	static const u_int uCURRENT_VERSION = 0;

#ifdef ASURA_TOOLS
	friend class ToolsAVP_Message_Editing;
	friend class Asura_Chunk_StaticMessages;
#endif
};

class AVP_Message_InteractionMoveStart : public Asura_Msg_Move
{
public:
	void SetInteractionObject( Asura_Guid uInteractionObjectGuid ) { m_uInteractionObjectGuid = uInteractionObjectGuid; }
	Asura_Guid GetInteractionObject() const { return m_uInteractionObjectGuid; }

	void SetNextMoveHash( const Asura_Hash_ID uNextMoveHash ) { m_uNextMoveHash = uNextMoveHash; }
	Asura_Hash_ID GetNextMoveHash() const { return m_uNextMoveHash; }

	void SetOn( const bool bOn ) { m_bOn = bOn; }
	bool GetOn() const { return m_bOn; }

private:
	Asura_Guid	m_uInteractionObjectGuid;
	Asura_Hash_ID m_uNextMoveHash;
	bool		m_bOn;
};

//-----------------------------------------------------------------------------------------------------------
// Class	: AVP_Message_AttackScriptedTarget
// Created	: 17 / 09 / 08
//-----------------------------------------------------------------------------------------------------------
class AVP_Message_AttackScriptedTarget
{

public:

	enum { CURRENT_MSG_VERSION = 1 };

	void Initialise()
	{
		m_uVersion		= CURRENT_MSG_VERSION;
		m_uShootAtGuid	= ASURA_GUID_UNREGISTERED;
	}

	u_int			m_uVersion;
	Asura_Guid		m_uShootAtGuid;
};

//-----------------------------------------------------------------------------------------------------------
// Class	: AVP_Message_Actor_Reload
// Created	: 13 / 02 / 09
//-----------------------------------------------------------------------------------------------------------
class AVP_Message_Actor_Reload
{
public:

	AVP_Message_Actor_Reload() : m_uWeaponBlueprint(ASURA_HASH_ID_UNSET){}

	Asura_Hash_ID m_uWeaponBlueprint;
};

////////////////////////////////////////////////////////////////////////////////
// Class		: AVP_Message_Actor_Attachment
// Author		: Chris Wallace
//	
// Description	: Add or Remove a skin to/from a markerpoint
////////////////////////////////////////////////////////////////////////////////

class AVP_Message_Actor_Attachment
{
public:

	// CHANGE THE DATA - CHANGE THE VERSION!
	enum { CURRENT_MSG_VERSION = 0 };

	void Initialise()
	{
		m_uVersion = CURRENT_MSG_VERSION;
		m_uBlueprintHash = ASURA_HASH_ID_UNSET;
	}

	u_int m_uVersion;
	Asura_Hash_ID m_uBlueprintHash;		
};

class AVP_Message_Actor_RequestTurn
{
public:
	void	SetTurnAngle( const float fTurnAngle ) { m_fTurnAngle = fTurnAngle; }
	float	GetTurnAngle() const { return m_fTurnAngle; }

private:
	float	m_fTurnAngle;

};

class AVP_Msg_Move_Start_GS2RigidAnim : public Asura_Msg_Move
{
public:
	Asura_Hash_ID GetAnimHash() const { return m_uAnimHash; }
	u_int GetAnimFlags() const { return m_uAnimFlags; }
	float GetTweenDuration() const { return m_fTweenTime; }
	float GetParametricStartTime() const { return m_fParametricStartTime; }
	const Asura_Quat& GetStartOrientation() const { return m_xStartOri; }
	const Asura_Vector_3& GetStartPosition() const { return m_xStartPos; }

	void SetData( Asura_Hash_ID uAnimHash, const u_int uAnimFlags, const float fTweenTime, const float fParametricStartTime, const Asura_Quat& xStartOri, const Asura_Vector_3& xStartPos )
	{
		m_uAnimHash = uAnimHash;
		m_uAnimFlags = uAnimFlags;
		m_fTweenTime = fTweenTime;
		m_fParametricStartTime = fParametricStartTime;
		m_xStartOri = xStartOri;
		m_xStartPos = xStartPos;
	}

private:
	Asura_Hash_ID m_uAnimHash;
	u_int m_uAnimFlags;
	float m_fTweenTime;
	float m_fParametricStartTime;
	Asura_Quat m_xStartOri;
	Asura_Vector_3 m_xStartPos;

};

#endif   // ifndef __AVP_ACTOR_MESSAGES_H__

/// End of file. ///
