本文整理汇总了C++中Stone::togglePixmap方法的典型用法代码示例。如果您正苦于以下问题:C++ Stone::togglePixmap方法的具体用法?C++ Stone::togglePixmap怎么用?C++ Stone::togglePixmap使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Stone
的用法示例。
在下文中一共展示了Stone::togglePixmap方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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;
}
示例2: removeDeadGroup
bool StoneHandler::removeDeadGroup(int x, int y, int &caps, StoneColor &col, bool &dead)
{
if (hasStone(x, y) != 1)
return false;
Stone *s = getStoneAt(x, y);
CHECK_PTR(s);
col = s->getColor();
if (!s->isDead())
dead = true;
Group *g = assembleGroup(s, NULL); //SL added eb 8
CHECK_PTR(g);
caps = g->count();
// Mark stones of this group as dead or alive again
QListIterator<Stone *> it(*g);
while (it.hasNext())
{
Stone *s = it.next();
CHECK_PTR(s);
s->setDead(dead);
if (dead)
{
s->togglePixmap(boardHandler->board->getImageHandler()->getGhostPixmaps(),
false);
}
else
{
s->togglePixmap(boardHandler->board->getImageHandler()->getStonePixmaps(),
true);
}
}
delete g;
return true;
}
示例3: removeDeadMarks
void StoneHandler::removeDeadMarks()
{
Q3IntDictIterator<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->togglePixmap(boardHandler->board->getImageHandler()->getStonePixmaps(),
true);
}
++it;
}
}