new class Alien

global restruct ALL!!
This commit is contained in:
2010-02-03 17:18:26 +03:00
parent 758cfeb967
commit 4ad7d83625
12 changed files with 619 additions and 273 deletions

View File

@@ -66,6 +66,7 @@ bool Aliens::CreatePath(Alien * al)
for (int i = 0; i < data->size.width(); i++) {
for (int j = 0; j < data->size.height(); j++) TmpCells[i][j] = data->Cells[i][j];
}
al->path.clear();
al->PathIndex = 0;
if (WaveTrace(al))
@@ -83,7 +84,7 @@ bool Aliens::CreatePath(Alien * al)
}
tp = al->path[al->path.size() - 1];
tmpPnt.push_back(tp);
qDebug() << tmpPnt.size();
//qDebug() << tmpPnt.size();
al->path = tmpPnt;
//al->Position.pnt.setX(al->path[0].x()*data->cellsize);
//al->Position.pnt.setY(al->path[0].y()*data->cellsize);
@@ -122,18 +123,18 @@ bool Aliens::WaveTrace(Alien * al) {
cp = al->Position.pnt/data->cellsize;
curp.push_back(cp);
TmpCells[cp.x()][cp.y()] = 1;
qDebug() << "trace";
while (!stop) {
qDebug() << "trace";
tmpp = curp;
curp.clear();
qDebug() << tmpp.size();
//qDebug() << tmpp.size();
stop = true;
for (int i = 0; i < tmpp.size(); i++) {
cp = tmpp[i];
if (cp == al->DestPnt) {
TmpCells[cp.x()][cp.y()] = step;
qDebug() << "true";
InvWaveTrace(cp, step, al);
qDebug() << "true";
qDebug() << al->path.size();
return true;
}