
#pragma once
#ifndef GROUP_HPP
#define GROUP_HPP

#include "AI_Squad.hpp"
#include <Stuff\Auto_Ptr.hpp>
#pragma warning (push)
#include "stlport\vector"
#pragma warning (pop)



namespace Adept
{
	class Entity;
};

namespace MechWarrior4
{
	class Group
	{
	  public:
	    typedef int identifier;

		Group(identifier id);
		~Group() { }

		identifier GetID() const;

		void UpdateAI(CombatAI& combat_ai);

		void SetSquadAI(Stuff::Auto_Ptr<MW4AI::Squad::AI>& squad_ai);

		void NotifyShot(Adept::ObjectID id);

		void NotifyShotFired(const Stuff::Line3D& line,
							 MWObject& at_who,
							 MWObject& shooter);

		Adept::Entity* IDToEntity(Adept::ObjectID id) const;

		bool HasAI() const;
		const MW4AI::Squad::AI* GetAI() const;
		MW4AI::Squad::AI* GetAI();

		bool IgnoresFriendlyFire() const;

		void GetMembers(std::vector<MWObject*>& members) const;

		void AddObject(Adept::ObjectID object);
		void RemoveObject(Adept::ObjectID object);

		typedef std::vector<Adept::ObjectID> element_list;
		const element_list& GetElements() const;

		void NotifyMechDestroyed(const Adept::ReplicatorID& inflicting_id, const Adept::ReplicatorID& victim_id);

	  private:
	    identifier m_id;
		Stuff::Auto_Ptr<MW4AI::Squad::AI> m_SquadAI;
		element_list m_Elements;
	};
};


#endif // GROUP_HPP
