void StoneHandler::removeDeadMarks() { QIntDictIterator<Stone> it(*stones); Stone *s; while (it.current()) { s = it.current(); CHECK_PTR(s); if (s->isDead() || s->isSeki()) { s->setDead(false); s->setSeki(false); s->setSequence(boardHandler->board->getImageHandler()->getStonePixmaps()); s->shadow->show(); } ++it; } }
bool StoneHandler::markSekiGroup(int x, int y, int &caps, StoneColor &col, bool &seki) { if (hasStone(x, y) != 1) return false; Stone *s = getStoneAt(x, y); CHECK_PTR(s); col = s->getColor(); if (!s->isSeki()) seki = true; Group *g = assembleGroup(s, NULL); //SL added eb 8 CHECK_PTR(g); // Mark stones of this group as seki QListIterator<Stone *> it(*g); while (it.hasNext()) { Stone *s = it.next(); CHECK_PTR(s); if (seki && s->isDead()) caps ++; s->setSeki(seki); if (seki) { s->togglePixmap(boardHandler->board->getImageHandler()->getGhostPixmaps(), false); } else { s->togglePixmap(boardHandler->board->getImageHandler()->getStonePixmaps(), true); } } delete g; return true; }
bool StoneHandler::markSekiGroup(int x, int y, int &caps, StoneColor &col, bool &seki) { if (hasStone(x, y) != 1) return false; Stone *s = getStoneAt(x, y); CHECK_PTR(s); col = s->getColor(); if (!s->isSeki()) seki = true; Group *g = assembleGroup(s, NULL); //SL added eb 8 CHECK_PTR(g); // Mark stones of this group as seki QListIterator<Stone> it(*g); for (; it.current(); ++it) { s = it.current(); CHECK_PTR(s); if (seki && s->isDead()) caps ++; s->setSeki(seki); if (seki) { s->setSequence(boardHandler->board->getImageHandler()->getGhostPixmaps()); s->shadow->hide(); } else { s->setSequence(boardHandler->board->getImageHandler()->getStonePixmaps()); s->shadow->show(); } } delete g; return true; }