本文整理汇总了C++中BallSprite::getIgnoreCheck方法的典型用法代码示例。如果您正苦于以下问题:C++ BallSprite::getIgnoreCheck方法的具体用法?C++ BallSprite::getIgnoreCheck怎么用?C++ BallSprite::getIgnoreCheck使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BallSprite
的用法示例。
在下文中一共展示了BallSprite::getIgnoreCheck方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getRowChain
void BallMap::getRowChain(BallSprite *ball, std::list<BallSprite *> &chainList)
{
chainList.push_back(ball);// add first Ball
int neighborRow = ball->getRow() - 1;
while (neighborRow >= 0)
{
BallSprite *neighborBall = m_matrix[neighborRow * (int)m_size.width + ball->getCol()];
if (neighborBall
&& (neighborBall->getImgIndex() == ball->getImgIndex())
&& (!neighborBall->getIsNeedRemove() || !ball->getIsNeedRemove())
&& !neighborBall->getIgnoreCheck())
{
chainList.push_back(neighborBall);
neighborRow--;
}
else
{
break;
}
}
neighborRow = ball->getRow() + 1;
while (neighborRow < m_size.height)
{
BallSprite *neighborBall = m_matrix[neighborRow * (int)m_size.width + ball->getCol()];
if (neighborBall
&& (neighborBall->getImgIndex() == ball->getImgIndex())
&& (!neighborBall->getIsNeedRemove() || !ball->getIsNeedRemove())
&& !neighborBall->getIgnoreCheck())
{
chainList.push_back(neighborBall);
neighborRow++;
}
else
{
break;
}
}
}
示例2: checkAndRemoveChain
void BallMap::checkAndRemoveChain()
{
BallSprite *ball;
// 1. reset ingnore flag
for (int i = 0; i < m_size.height * m_size.width; i++)
{
ball = m_matrix[i];
if (!ball) {
continue;
}
ball->setIgnoreCheck(false);
}
// 2. check chain
std::list<BallSprite *> longerList;
for (int i = 0; i < m_size.height * m_size.width; i++)
{
ball = m_matrix[i];
if (!ball)
{
continue;
}
if (ball->getIsNeedRemove())
{
continue;// 已标记过的跳过检查
}
if (ball->getIgnoreCheck())
{
// continue;// 新变化的特殊寿司,不消除
}
// start count chain
std::list<BallSprite *> colChainList;
getColChain(ball, colChainList);
if (colChainList.size() >= 3)
{
longerList.merge(colChainList);
}
std::list<BallSprite *> rowChainList;
getRowChain(ball, rowChainList);
if (rowChainList.size() >= 3)
{
longerList.merge(rowChainList);
}
if (longerList.size() < 3)
{
m_isNeedCheckSelf = false;
TwoBallPos towBall = this->selfCheckHaveMore();
if (isPointEqual(towBall.srcPos, towBall.destPos))
{
this->removeAllBall(true);
}
continue;// 小于3个不消除
}
std::list<BallSprite *>::iterator itList;
// longerList.sort(); //sort the list
// longerList.erase( unique( longerList.begin(), longerList.end() ), longerList.end());//Remove duplicate list values
for (itList = longerList.begin(); itList != longerList.end(); itList++)
{
ball = dynamic_cast<BallSprite*>(*itList);
if (!ball)
{
continue;
}
markRemove(ball);
}
// 如何是自由掉落产生的4消, 取最后一个变化为特殊寿司
if (longerList.size() > 3)
{
ball->setIgnoreCheck(true);
ball->setIsNeedRemove(false);
ball->setDisplayMode(DISPLAY_MODE_FOUR);
}
}
if (longerList.size() >= 3)
{
m_readyRemoveList = longerList;
}
// 3.消除标记了的寿司
removeBall();
}