
#pragma once
#ifndef AI_LANCEMATE_HPP
#define AI_LANCEMATE_HPP

#include "AI_RadioSquad.hpp"
#include "AI_LancemateAudio.hpp"
#include <Stuff\Line.hpp>
#include <Stuff\Auto_Ptr.hpp>


namespace Adept
{
	class Entity;
};

namespace MechWarrior4
{
	class AI;
	class CombatAI;
};

namespace MW4AI
{
	namespace Squad
	{
		class Lancemate
			: public RadioSquad
		{
			DERIVED_SquadAI;

		  public:
			Lancemate();
			virtual ~Lancemate();

			typedef RadioSquad inherited;

			ID GetID() const;

			bool IgnoresFriendlyFire() const { return (true); }

			Stuff::Time GetLastLeaderFireTime() const;
			Stuff::Line3D* GetLeaderFireLine() const;

			Adept::ObjectID GetTargetToAvoid() const;
			void SetTargetToAvoid(Adept::ObjectID id);

			virtual void NotifyMechDestroyed(MechWarrior4::Group& group,
											 const Adept::ReplicatorID& inflicting_id,
											 const Adept::ReplicatorID& victim_id);

		  private:
			void Propagate_NotifyShotFired(MechWarrior4::Group& group);

		  private:
			Stuff::Auto_Ptr<Stuff::Line3D> m_LeaderFireLine;
			Stuff::Time m_LastLeaderFireTime;
			Stuff::Time m_LastPickTargetTime;
			Adept::ObjectID m_TargetToAvoid;
			Stuff::Time m_TargetToAvoidTime;

			LancemateAudio::AudioManager m_AudioManager;

			std::vector<CombatAI*> m_CombatAIsWithSquadOrders;
		};
	};
};



#endif // AI_LANCEMATE_HPP
