
#pragma once
#ifndef AI_FIRESTYLE_HPP
#define AI_FIRESTYLE_HPP

#include <Stuff\auto_ptr.hpp>
#pragma warning(push)
#include <stlport\string>
#pragma warning(pop)
#include "AI_FireParamPackage.hpp"



#define INTERFACE_FireStyle(post)													\
  public:																			\
	virtual void Execute(const FireParamPackage& params,							\
						 Stuff::ChainOf<MechWarrior4::Weapon *>& weapons,			\
						 Adept::Entity* target,										\
						 MechWarrior4::WeaponUpdate& weapon_update) ##post

#define PURE_FireStyle	  INTERFACE_FireStyle(=0;)
#define DERIVED_FireStyle INTERFACE_FireStyle(;)



namespace MechWarrior4	{ class Weapon; class Vehicle; class WeaponUpdate; }
namespace Adept			{ class Entity__CollisionQuery; }

namespace MW4AI
{
	class FireParamPackage;

	namespace FireStyles
	{
		enum FireStyleID
		{
			FIRE_OPPORTUNITY,	// change FIRE_FIRST if you change this,
			FIRE_MAXIMUM		// change FIRE_LAST if you change this
		};

		enum
		{
			FIRE_FIRST = FIRE_OPPORTUNITY,
			FIRE_LAST = FIRE_MAXIMUM
		};

		void VerifyFireStyle(FireStyleID id);
		std::string FireStyleToString(FireStyleID id);

		class FireStyle
		{
			PURE_FireStyle;

		  public:
			virtual bool CanAlwaysFireAtSecondaryTargets() const	{ return (false); }
			virtual bool ShouldFireAtPrimaryTarget() const			{ return (true); }

			virtual FireStyleID GetID() const = 0;
			virtual ~FireStyle() {};

			static bool gHeatManagementEnabled;
		};

		Auto_Ptr<FireStyle> CreateFireStyle(FireStyleID id);

		class MaximumFire
			: public FireStyle
		{
			DERIVED_FireStyle;

		  public:
			FireStyleID GetID() const { return (FIRE_MAXIMUM); }
		};

		class OpportunityFire
			: public MaximumFire
		{
		  public:
			bool CanAlwaysFireAtSecondaryTargets() const	{ return (true); }
			bool ShouldFireAtPrimaryTarget() const			{ return (false); }

			FireStyleID GetID() const { return (FIRE_OPPORTUNITY); }
		};
	};
};

#endif // AI_FIRESTYLE_HPP