#include "BreakoutLGAlternate.h"

BreakoutLGAlternate::BreakoutLGAlternate()
{

}

BreakoutLGAlternate::~BreakoutLGAlternate()
{

}

BreakoutLevel* BreakoutLGAlternate::GenerateLevel(BreakoutLocationArray *pAvailableLocations, const Vector2i &boxSize, const int &maxHealth)
{
	BreakoutLevel* pLevel = new BreakoutLevel();

	for(int y = 0; y < pAvailableLocations->GetHeight(); y++)
	{
		for(int x = (y % 2); x < pAvailableLocations->GetWidth(); x+=2)
		{
			int health = static_cast<int>((((float)y / (float)pAvailableLocations->GetHeight()) * (float)maxHealth) + 0.5f); //Round up
			Vector2i pos = pAvailableLocations->GetLocation(x,y);
			pLevel->push_back(new BreakoutBox(pos, boxSize, health));
		}
	}

	return pLevel;
}
