本文整理汇总了C++中Q3ValueList::contains方法的典型用法代码示例。如果您正苦于以下问题:C++ Q3ValueList::contains方法的具体用法?C++ Q3ValueList::contains怎么用?C++ Q3ValueList::contains使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Q3ValueList
的用法示例。
在下文中一共展示了Q3ValueList::contains方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: checkNeighbourLiberty
void StoneHandler::checkNeighbourLiberty(int x, int y, Q3ValueList<int> &libCounted, int &liberties, Matrix *m) //SL added eb 8
{
if (!x || !y)
return;
Stone *s;
// CHECK_PTR(m); // SL added eb 8
if (m==NULL) //added eb 8 -> we don't have a matrix passed here, so we check on the board
{
if (x <= boardHandler->board->getBoardSize() && y <= boardHandler->board->getBoardSize() && x >= 0 && y >= 0 &&
!libCounted.contains(100*x + y) &&
((s = stones->find(Matrix::coordsToKey(x, y))) == NULL ||
!s->isVisible()))
{
libCounted.append(100*x + y);
liberties ++;
}
}
else
{
if (x <= boardHandler->board->getBoardSize() && y <= boardHandler->board->getBoardSize() && x >= 0 && y >= 0 &&
!libCounted.contains(100*x + y) &&
(m->at(x - 1, y - 1) == stoneNone )) // ?? check stoneErase ?
{
libCounted.append(100*x + y);
liberties ++;
} // end add eb 8
}
}
示例2: QCOMPARE
void tst_Q3ValueList::contains()
{
Q3ValueList<int> a;
a.append( 1 );
a.append( 10 );
a.append( 100 );
a.append( 1000 );
a.append( 1000 );
QCOMPARE( (int)a.contains(1), 1 );
QCOMPARE( (int)a.contains(10), 1 );
QCOMPARE( (int)a.contains(99), 0 );
QCOMPARE( (int)a.contains(1000), 2 );
}
示例3: checkNeighbourLibertyOnMatrix
void StoneHandler::checkNeighbourLibertyOnMatrix(int x, int y, Q3ValueList<int> &libCounted, int &liberties, Matrix *m)
{
if (!x || !y)
return;
// Stone *s;
if (x <= boardHandler->board->getBoardSize() && y <= boardHandler->board->getBoardSize() && x >= 0 && y >= 0 &&
!libCounted.contains(100*x + y) &&
(m->at(x - 1, y - 1) == MARK_TERRITORY_DONE_BLACK ||
m->at(x - 1, y - 1) == MARK_TERRITORY_DONE_WHITE))
{
libCounted.append(100*x + y);
liberties ++;
}
}