///////////////////////////////////////////////////////////////////////////////
//
// File   : AVP_Messages_Dropship.h
// Author : Sharon Galtzur
// Date   : 23-Sep-2008
//
// Copyright (C) 2008 Rebellion, All Rights Reserved.
//
///////////////////////////////////////////////////////////////////////////////

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

#ifndef __AVP_MESSAGES_DROPSHIP_H__
#define __AVP_MESSAGES_DROPSHIP_H__

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

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

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

class Asura_NetMsg;
class AVP_ServerVehicle_Dropship;

////////////////////////////////////////////////////////////////////////////////
// Class        : AVP_Message_DropshipClientUpdate
////////////////////////////////////////////////////////////////////////////////

class AVP_Message_DropshipClientUpdate : public AVP_Message_Actor_ClientUpdate
{
public:
	void FillDropship( const AVP_ServerVehicle_Dropship& xDropship );

	// Accessor functions...
	bool IsLaserOn() const { return m_bIsLaserOn; }
	const Asura_Vector_3& GetLaserTarget() const { return m_xLaserTarget; }
	float GetVelocityFraction() const { return m_fVelocityFraction; }

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

protected:
	AVP_Message_DropshipClientUpdate() {}

private:
	bool m_bIsLaserOn;
	Asura_Vector_3 m_xLaserTarget;
	float m_fVelocityFraction;

};


////////////////////////////////////////////////////////////////////////////////
// Class        : AVP_Message_Dropship_RequestAnimation
////////////////////////////////////////////////////////////////////////////////
struct AVP_Message_Dropship_RequestAnimation
{
	enum RequestType
	{
		// time dependent requests
		REQUEST_ANIM_FLAPS_RIGHTLEFT = 0,
		REQUEST_ANIM_FLAPS_DOWNUP,
		REQUEST_ANIM_THRUSTERS_FRONTBACK,
		REQUEST_ANIM_LAST_ANIM_WITH_TIME,
		// non time depnendent requests
		REQUEST_ANIM_OPEN_FRONT_MISSILE_PODS,
		REQUEST_ANIM_CLOSE_FRONT_MISSILE_PODS,
		REQUEST_ANIM_OPEN_BACK_MISSILE_PODS,
		REQUEST_ANIM_CLOSE_BACK_MISSILE_PODS,
		REQUEST_ANIM_OPEN_BACK_MISSILE_PODS_DOORS,
		REQUEST_ANIM_CLOSE_BACK_MISSILE_PODS_DOORS,
	} m_eRequestType;

	float m_fDesiredTime; // not always used

	AVP_Message_Dropship_RequestAnimation(AVP_Message_Dropship_RequestAnimation::RequestType eRequestType , float fDesiredTime = 0.0f) 
	: m_eRequestType(eRequestType)
	, m_fDesiredTime(fDesiredTime)
	{}
};

//------------------------------------------------------------------------------
// Class        : AVP_Message_DropshipAttackMode
//------------------------------------------------------------------------------
class AVP_Message_DropshipAttackMode
{
public:

	void Initialise(void)
	{
		m_uVersion = 1;
		m_eMode = DSAM_USE_NOTHING;
	}

	u_int		m_uVersion;
	enum Mode
	{
		DSAM_USE_NOTHING,
		DSAM_USE_MACHINEGUN,
		DSAM_USE_MISSILES,
		DSAM_USE_MISSILES_BUT_MISS,
		DSAM_USE_MACHINEGUN_AND_USE_MISSILES,
		DSAM_MODES_COUNT
	} m_eMode;

	void SetMode(AVP_Message_DropshipAttackMode::Mode eMode) { m_eMode = eMode; }
	AVP_Message_DropshipAttackMode::Mode GetMode(void) const {return m_eMode;}

	static const char**	GetModeNames( void ) { return s_aszDropshipAttackMode; }
	static const char* s_aszDropshipAttackMode[DSAM_MODES_COUNT];
};


#endif   // ifndef __AVP_MESSAGES_DROPSHIP_H__


/// End of file. ///
