
///////////////////////////////////////////////////////////////////////////////
//
// File   : AVP_ServerProjectile_DropshipMissile.h
// Author : Chris Wallace
// Date   : 04-June-2007
//
// Copyright (C) 2007 Rebellion, All Rights Reserved.
//
///////////////////////////////////////////////////////////////////////////////

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

#ifndef __AVP_SERVERPROJECTILE_DROPSHIP_MISSILE_H__
#define __AVP_SERVERPROJECTILE_DROPSHIP_MISSILE_H__

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

#include "Entity/PhysicalObject/Projectile/AVP_ServerProjectile_GenericProjectile.h"

////////////////////////////////////////////////////////////////////////////////
// Class        : AVP_ServerProjectile_DropshipMissile
// Author       : Chris Wallace
// Date         : 04-June-2007
//
// Description  : Class to handle the DropshipMissile
////////////////////////////////////////////////////////////////////////////////

class AVP_ServerProjectile_DropshipMissile : public AVP_ServerProjectile_GenericProjectile
{
public:
	// Public functions...
	static	AVP_ServerProjectile_DropshipMissile* Create( const Asura_Message* pxMsg );

	// Overridden functions...
	virtual	void Update(void);
	virtual void Launch(const Asura_Vector_3& xPosition, const Asura_Matrix_3x3& xOrientation, const Asura_Vector_3& xVelocity, const Asura_Guid uGuidToIgnore, float fDamageMultiplier);


	// Overridden chunk-handling functions...
	virtual	void ReadFromChunkStream(Asura_Chunk_Stream& xStream);
	virtual	void WriteToChunkStream(Asura_Chunk_Stream& xStream) const;
	virtual bool CanBeSavedToChunk(void) const	{ return(false); }

	// Legacy chunk handling, to be removed as soon as possible...
	virtual	bool IsFilledFromChunkBuffer (void) const { return(false); }

	// Static list accessors...
	static	AVP_ServerProjectile_DropshipMissile* FindEntity(const Asura_Guid uGuid) { return(s_xList.FindEntity(uGuid)); }
	static	const Asura_Hashed_List<AVP_ServerProjectile_DropshipMissile>* GetList(void) { return(&s_xList); }

protected:
	// Protected variables...
	
	// Protected functions...
	AVP_ServerProjectile_DropshipMissile(const Asura_Guid uGuid, const Asura_Message* pxMsg);
	virtual ~AVP_ServerProjectile_DropshipMissile();

	// Overridden entity update functions...
	virtual	void MakeClientUpdateMessage(void);

	void SetMaxVelocity(float fMaxVelocity) { m_fMaxVelocity = fMaxVelocity; }

private:

	enum PursuitMode 
	{
		BLIND_START,
		CLIMB,
		PURSUIT,
		BLIND_END
	} m_ePursuitMode;

	float m_fTimeSinceLaunch;
	Asura_Vector_3 m_xStartPosition;
	float m_fMaxVelocity;

	typedef AVP_ServerProjectile_GenericProjectile PARENT;

	static		Asura_Hashed_List<AVP_ServerProjectile_DropshipMissile>	s_xList;

	// Private functions...
	AVP_ServerProjectile_DropshipMissile(void);
	AVP_ServerProjectile_DropshipMissile(const AVP_ServerProjectile_DropshipMissile& xOther);

	AVP_ServerProjectile_DropshipMissile& operator =(const AVP_ServerProjectile_DropshipMissile& xOther);

};   // End of class 'AVP_ServerProjectile_DropshipMissile'.


#endif   // ifndef __AVP_SERVERPROJECTILE_DROPSHIP_MISSILE_H__


/// End of file. ///
