#include "adcore.h"

adCore::adCore(QObject *parent) :
    QThread(parent)
{
	step = 0;
	//admap = new Map(1);
	//addata = new Game_Data(admap);
	adloader = new Loader();
	addata = adloader->loadlevel(1);
	if (addata != 0) qDebug("Sucsess");
	else qDebug("Error");
	//admap->load();
	//adload->create();
	//adload->readAliens();
//	Player * pl1 = new Player(0);
//	Player * pl2 = new Player(0);
//	addata->players.push_back(pl1);
//	addata->players.push_back(pl2);
//	adaliens = new Aliens(addata);
//	adtowers = new Towers(addata);
//	adsplashes = new Splashes(addata);
//	connect(admap,SIGNAL(RecreateAlienPath(bool*)),adaliens,SLOT(retrace(bool*)));
//	adaliens->AddAlien(0);
//	adaliens->AddAlien(0);
//	adaliens->AddAlien(0);
//	for (int i=0; i<qMin(admap->mapsize.width(),admap->mapsize.height()); i++)
//		adtowers->AddTower(0,0,QPoint(i,i));
//	for (int i=0; i<admap->mapsize.height();i++)
//		adtowers->AddTower(1,0,QPoint(admap->mapsize.width()-2,i));
}


void adCore::next()
{
	adtowers->update();
	adsplashes->update();
	adaliens->update();
	step++;
}
