//---------------------------
// Includes
//---------------------------
#include "StdAfx.h"
#include "Food.h"
#include "FoodList.h"
#include "Painter.h"
#include "ResourceLoader.h"
#include "InputState.h"
#include "CollisionMesh.h"
#include "Image.h"

//---------------------------
// Constructor & Destructor
//---------------------------
FoodList::FoodList(): ItemList()
{
}

FoodList::~FoodList()
{
	// Deletes all the elements in the array, 
	// Uses the RemoveAll method
	this->RemoveAll();
}

//---------------------------
// Own methods
//---------------------------

void FoodList::HitTest(Character* character)
{
	// Searches in the list for Food that hits the given character
	// When a Food is hit, it gets removed
	for(int i = 0; i < MAX_NR_OF_ITEMS;++i)
	{
		if(m_ItemPtrArr[i] != 0)
		{
			if(m_ItemPtrArr[i]->HitTest(character))
				Remove(m_ItemPtrArr[i]);
		}
	}
}