//////////////////////////////////////////////////////////////////////////////
//
// AVP_ClientVehicle_Dropship.h
//
// Copyright (c) 2007 Rebellion. All rights reserved.
//
//////////////////////////////////////////////////////////////////////////////

// B E G I N   F I L E   W R A P P E R ///////////////////////////////////////

#ifdef ASURA_USE_PRAGMA_ONCE
	#pragma once
#endif

#ifndef AVP_CLIENTVEHICLE_DROPSHIP_H___
#define AVP_CLIENTVEHICLE_DROPSHIP_H___ 1

// I N C L U D E S ///////////////////////////////////////////////////////////

// Asura

// AVP
#include "Entity/PhysicalObject/Actor/Vehicles/AVP_ClientActor_Vehicle.h"

#include "Actor/Vehicles/Dropship/AVP_Dropship_AnimationHandler.h"

// F O R W A R D   D E C L A R A T I O N S ///////////////////////////////////

class Asura_Message;
class AVP_AnimationAttachment_Laser;
class AVP_Message_DropshipClientUpdate;
class AVP_Dropship_AnimationHandler;

// C L A S S E S /////////////////////////////////////////////////////////////

class AVP_ClientVehicle_Dropship : public AVP_ClientActor_Vehicle
{
public:
	// Public functions...
	static	AVP_ClientVehicle_Dropship*	Create	(const Asura_Message* pxMessage);

	virtual	bool HandleMessage(const Asura_Message* pxMessage);
	virtual	void Update();


	bool AreFrontPodsOpened() const { return GetDropshipAnimatiomHandler()->AreFrontPodsOpened(); }
	bool AreFrontPodsClosed() const { return GetDropshipAnimatiomHandler()->AreFrontPodsClosed(); }
	bool AreBackPodsOpened() const { return GetDropshipAnimatiomHandler()->AreBackPodsOpened(); }
	bool AreBackPodsClosed() const { return GetDropshipAnimatiomHandler()->AreBackPodsClosed(); }
	bool AreBackPodsDoorsOpened() const { return GetDropshipAnimatiomHandler()->AreBackPodsDoorsOpened(); }
	bool AreBackPodsDoorsClosed() const { return GetDropshipAnimatiomHandler()->AreBackPodsDoorsClosed(); }

	// Static list functions...
	static AVP_ClientVehicle_Dropship* FindEntity( Asura_Guid uGUID )				{ return s_xList.FindEntity( uGUID ); }
	static const Asura_Hashed_List<AVP_ClientVehicle_Dropship>* GetList( void )		{ return &s_xList; }

	
protected:
	AVP_ClientVehicle_Dropship();
	virtual ~AVP_ClientVehicle_Dropship();
	virtual void PostCreateInitialise();
	virtual void PreDestructionShutdown();
	virtual void CreateAnimationHandler();
	virtual void InitialiseFromBlueprint( const Asura_Blueprint& xBlueprint );
	virtual void OnEntityActivate();
	virtual void OnEntityDeactivate();

    void ProcessClientUpdate(const AVP_Message_DropshipClientUpdate* pxData, float fServerTime, bool bProcessPosAndOri = true);

private:

	AVP_Dropship_AnimationHandler* GetDropshipAnimatiomHandler() const { return static_cast<AVP_Dropship_AnimationHandler*>(m_pxAnimationHandler); }


	// Private typedefs...
	typedef AVP_ClientActor_Vehicle PARENT;

	AVP_AnimationAttachment_Laser*	m_pxLaserAttachment;
	float m_fVolumeFraction;
	float m_fPitchFraction;
	Asura_Hash_ID m_uEnginesSoundHash;
	Asura_Hash_ID m_uExtraEnginesSoundHash;
	Asura_Handle  m_iEnginesSoundHandle;
	Asura_Handle  m_iExtraEnginesSoundHandle;
	float m_fMinEngineVolume;
	float m_fMaxEngineVolume;
	float m_fMinEnginePitch;
	float m_fMaxEnginePitch;
	static Asura_Hashed_List<AVP_ClientVehicle_Dropship> s_xList;

	// Private functions...
};

// E N D   F I L E   W R A P P E R ///////////////////////////////////////////

#endif // #ifndef AVP_CLIENTVEHICLE_DROPSHIP_H___
