//============================================================================//
// File:	misthrst.hh                                                          //
// Project: BattleTech																	      //
// Contents: Missile Thruster provides power to move the missile  				//
//----------------------------------------------------------------------------//
//   Date    Who  Modification                                                //
// --------  ---  ------------------------------------------------------------//
// 04/13/95  JM  Initial coding.                                              //
//----------------------------------------------------------------------------//
// Copyright (C) 1995, Virtual World Entertainment, Inc. All Rights reserved  //
//                   	PROPRIETARY AND CONFIDENTIAL                          //
//============================================================================//

#if !defined (MISTHRST_HPP)
	#define	MISTHRST_HPP

	#if !defined(SUBSYSTM_HPP)
		#include <subsystm.hpp>
	#endif

	#if !defined(ANGLE_HPP)
		#include <angle.hpp>
	#endif

	#if !defined(MOTION_HPP)
		#include <motion.hpp>
	#endif

//###################    Froward Class Declarations   ######################
class Missile;

//###################    MissileThruster  SubsystemResource    #################

	struct MissileThruster__SubsystemResource:
		public Subsystem::SubsystemResource
	{
		Scalar burnTime;
		Degree maxThrusterRotationRate;
		Scalar thrusterAcceleration;
		Scalar thrusterClimb;
	};


//###########################################################################
//#########################     CLASS -- MissileThruster   ##################
//###########################################################################


	class MissileThruster :
		public Subsystem
	{

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Shared Data Support
//
	public:
		static Derivation ClassDerivations;
		static SharedData DefaultData;

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Attribute Support
//

public:
		enum {
			BurnTimeRemainingAttributeID = Subsystem::NextAttributeID,
			MaxThrusterRotationRateAttributeID,
			ThrusterAccelerationAttributeID,
			NextAttributeID
		};

	public:
		static const IndexEntry AttributePointers[];

	protected:
		static AttributeIndexSet	AttributeIndex;

	//
	// public attribute declarations go here
	//
	public:
		Scalar 			burnTimeRemaining;
		Radian			maxThrusterRotationRate;
		const Scalar			thrusterAcceleration;
		const Scalar			thrusterClimb;
      Motion			acceleration;


//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Model Support
//
	public:
		enum {
			ThrusterBurning= Subsystem::StateCount,
			StateCount
		};

		typedef void
			(MissileThruster::*Performance)(Scalar time_slice);

		void
			MissileThrusterSimulation(Scalar time_slice);

		void
			SetPerformance(Performance performance)
			{
				Check(this);
				activePerformance = (Simulation::Performance)performance;
			}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// 	TestClass Support
//
	public:

		static Logical
			TestClass(Missile &);

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Construction and Destruction
//
	public:

		typedef MissileThruster__SubsystemResource SubsystemResource;

		MissileThruster(
			Missile			*owner,
         int				subsystem_ID,
			SubsystemResource	*subsystem_resource
			);
		~MissileThruster();

		Logical
			TestInstance() const;

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Local Support
//
	
};
#endif
