// Created 3/15/2002 by ASH&ACS - IFF Jammer

#pragma once

#include "MW4.hpp"
#include "Subsystem.hpp"

namespace MechWarrior4
{
	typedef Subsystem__ClassData							IFF_Jammer__ClassData; //*** 
	typedef Subsystem__Message								IFF_Jammer__Message;
	typedef Subsystem__ExecutionStateEngine					IFF_Jammer__ExecutionStateEngine;
	typedef Subsystem__CreateMessage						IFF_Jammer__CreateMessage;



	//#################################################################################
	//###########################   IFF Jammer GameModel    ###########################
	//#################################################################################

	class IFF_Jammer__GameModel:
		public Subsystem::GameModel
	{
	public:
		typedef Subsystem::GameModel BaseClass;

		Stuff::Scalar
			m_targeterMissileLockPercent;

		enum {
			TargeterMissileLockPercentAttributeID = Subsystem__GameModel::NextAttributeID,
			NextAttributeID
		};

		static bool
			ReadAndVerify(
				IFF_Jammer__GameModel *model,
				ModelAttributeEntry *attribute_entry, 
				const char *data,
				char **error,
				int error_buffer = 128
			);


		static void
			ConstructGameModel(Script *script);
	};




	//##########################################################################
	//########################   IFF    #############################
	//##########################################################################

	class IFF_Jammer:
		public Subsystem
	{
	public:
		static void
			InitializeClass();
		static void
			TerminateClass();

		typedef Subsystem BaseClass;

	//##########################################################################
	// Inheritance support
	//
	public:
		typedef IFF_Jammer__ClassData						ClassData;
		typedef IFF_Jammer__GameModel						GameModel;
		typedef IFF_Jammer__Message							Message;
		typedef IFF_Jammer__ExecutionStateEngine			ExecutionStateEngine;
		typedef IFF_Jammer__CreateMessage					CreateMessage;


	//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	// Run-time Construction and Destruction Support
	//
	public:
		static IFF_Jammer* 
			Make(
				CreateMessage *message,
				ReplicatorID *base_id
			);
	protected:
		IFF_Jammer(
			ClassData *class_data,
			CreateMessage *message,
			ReplicatorID *base_id,
			ElementRenderer::Element *element
		);

		~IFF_Jammer();


	//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	// Class Data & Game Model Support
	//
	public:
		const GameModel*
			GetGameModel()
				{return Cast_Pointer(const GameModel*, gameModelResource.GetPointer());}


	//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	// Shared Data support
	//
	public:
		static ClassData
			*DefaultData;

	//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	// Simulation Support
	//
	public:
		void
			DestroySubsystem();

	//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	// Test Support
	//
	public:
		void
      		TestInstance() const;
	};
}


