15
int Group::compareItems(Item d1, Item d2)
17
Stone *s1 = static_cast<Stone*>(d1);
18
Stone *s2 = static_cast<Stone*>(d2);
23
if (s1->posX() == s2->posX() &&
24
s1->posY() == s2->posY() &&
25
s1->getColor() == s2->getColor())
31
bool Group::isAttachedTo(Stone *s)
35
int stoneX = s->posX(),
38
StoneColor col = s->getColor(), c;
44
for (unsigned int i=0; i<count(); i++)
50
if (((stoneX == x && (stoneY == y-1 || stoneY == y+1)) ||
51
(stoneY == y && (stoneX == x-1 || stoneX == x+1))) &&
62
qDebug(QString("Count: %1").arg(count()));
65
QListIterator<Stone> it(*this);
67
for (; it.current(); ++it)
70
qDebug(" (%d, %d) %s", s->posX(), s->posY(),
71
s->getColor() == stoneBlack ? "B" : "W");