#include "MW4Headers.hpp"

#include "AI_Moods.hpp"

#include <Stuff\Auto_Ptr.hpp>



using namespace MW4AI::Moods;

/*
template <class enum_type, class container_type>
Stuff::Auto_Ptr<container_type> CreateEnumContainer(enum_type first, enum_type last)
{
	container_type* container = new container_type;
	Verify(sizeof(enum_type) == sizeof(int));

	{for (int i = (int)first;
		  i != ((int)last) + 1;
		  ++i)
	{
		container->push_back((enum_type)i);
	}}

	return (container);
}
*/

Stuff::Auto_Ptr<MW4AI::Moods::Mood> MW4AI::Moods::CreateMood(MW4AI::Moods::ID mood)
{
	Verify(MW4AI::MOODMIN == DESPERATE_START);
	Verify(MW4AI::MOODMAX == BRUTAL_END);

	if ((mood >= DESPERATE_START) &&
		(mood <= DESPERATE_END))
	{
		return (new Desperate);
	}

	if ((mood >= DEFENSIVE_START) &&
		(mood <= DEFENSIVE_END))
	{
		return (new Defensive);
	}

	if ((mood >= NEUTRAL_START) &&
		(mood <= NEUTRAL_END))
	{
		return (new Neutral);
	}

	if ((mood >= AGRESSIVE_START) &&
		(mood <= AGRESSIVE_END))
	{
		return (new Aggressive);
	}

	if ((mood >= BRUTAL_START) &&
		(mood <= BRUTAL_END))
	{
		return (new Brutal);
	}

	Verify(!"Mood not found.");
	return (new (Neutral));
}

void VerifyMood(MW4AI::Moods::ID mood)
{
	Verify(MW4AI::MOODMIN == DESPERATE_START);
	Verify(MW4AI::MOODMAX == BRUTAL_END);

	Verify(mood >= MW4AI::MOODMIN);
	Verify(mood <= MW4AI::MOODMAX);
}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Desperate mood
//
/*
void MW4AI::Moods::Desperate::GetTactics(std::vector<Tactics::TacticID>& tactics) const
{
	tactics.push_back(TACTIC_RETREAT);
}*/

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Defensive mood
//
/*
void MW4AI::Moods::Defensive::GetTactics(std::vector<Tactics::TacticID>& tactics) const
{
//	tactics.push_back(TACTIC_REAR);
//	tactics.push_back(TACTIC_BACK_UP_AND_FIRE);

	tactics.push_back(TACTIC_RUSH);
}*/

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Neutral mood
//
/*
void MW4AI::Moods::Neutral::GetTactics(std::vector<Tactics::TacticID>& tactics) const
{
//	tactics.push_back(TACTIC_STAND_GROUND);
//	tactics.push_back(TACTIC_HIT_AND_RUN);

	tactics.push_back(TACTIC_RUSH);
}*/

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Aggressive mood
//
/*
void MW4AI::Moods::Aggressive::GetTactics(std::vector<Tactics::TacticID>& tactics) const
{
//	tactics.push_back(TACTIC_CIRCLE_OF_DEATH);
//	tactics.push_back(TACTIC_JOUST);
//	tactics.push_back(TACTIC_RUSH);
	tactics.push_back(TACTIC_RUSH);
}*/

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Brutal mood
//
/*
void MW4AI::Moods::Brutal::GetTactics(std::vector<Tactics::TacticID>& tactics) const
{
//	tactics.push_back(TACTIC_STOP_AND_FIRE);
//	tactics.push_back(TACTIC_RAM);
	tactics.push_back(TACTIC_RUSH);
}*/
