本文整理汇总了C++中Stone::setSeki方法的典型用法代码示例。如果您正苦于以下问题:C++ Stone::setSeki方法的具体用法?C++ Stone::setSeki怎么用?C++ Stone::setSeki使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Stone
的用法示例。
在下文中一共展示了Stone::setSeki方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: removeDeadMarks
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;
}
}
示例2: markSekiGroup
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;
}
示例3: markSekiGroup
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;
}