本文整理汇总了C++中PlayerEntity::getNext方法的典型用法代码示例。如果您正苦于以下问题:C++ PlayerEntity::getNext方法的具体用法?C++ PlayerEntity::getNext怎么用?C++ PlayerEntity::getNext使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PlayerEntity
的用法示例。
在下文中一共展示了PlayerEntity::getNext方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: missilePass
//魔弹传递
void BackgroundEngine::missilePass(bool rightOrder,int dst,int src,bool* passed,int missilePoint)
{
int i;
PlayerEntity* srcPlayer = getPlayerByID(src);
PlayerEntity* dstPlayer = getPlayerByID(dst);
PlayerEntity* next = dstPlayer;
passed[srcPlayer->getSeatNum()] = true;
for(i = 0;i < this->playerList.size();i++)
{
if(!*(passed+i) && (i != dstPlayer->getSeatNum()))
break;
}
if(i == this->playerList.size())
{
for(int j = 0;j < this->playerList.size();j++)
*(passed + j) = false;
}
if(rightOrder)
{
while((next->getColor() == dstPlayer->getColor()) || *(passed + next->getSeatNum()))
next = next->getNext();
coder.askForMissile(dst,src,missilePoint,next->getID());
}
else
{
while((next->getColor() == dstPlayer->getColor()) || passed[next->getSeatNum()])
next = this->getFront(next);
coder.askForMissile(dst,src,missilePoint,next->getID());
}
}
示例2: missileProcess
//魔弹处理
void BackgroundEngine::missileProcess(CardEntity* card,int src,int dst)
{
bool rightOrder;
BatInfor reply;
PlayerEntity* nextOpponent;
//确定传递方向
nextOpponent = this->getCurrentPlayer()->getNext();
while(nextOpponent->getColor() == this->currentPlayer->getColor())
nextOpponent = nextOpponent->getNext();
if(nextOpponent->getID() == dst)
rightOrder = true;
else
rightOrder = false;
bool passed[6];
for(int i = 0;i < this->playerList.size();i++)
{
passed[i] = false;
}
int missilePoint = 2;
QList<CardEntity*> cards;
do
{
cards.clear();
//魔弹传递到下家
missilePass(rightOrder,dst,src,passed,missilePoint);
//读取用户回复
reply = messageBuffer::readBatInfor();
if(reply.reply == 0)
{
//继续传递
src = dst;
dst = reply.dstID;
missilePoint++;
cards << getCardByID(reply.CardID);
this->useCard(cards,getPlayerByID(src),getPlayerByID(dst),false);
continue;
}
else if(reply.reply == 1)
{
//圣光
cards << getCardByID(reply.CardID);
this->useCard(cards,getPlayerByID(dst));
break;
}
else if(reply.reply == 2)
{
//无应对
PlayerEntity* dstPlayer = getPlayerByID(dst);
bool shieldBlocked = false;
//检查圣盾
for(int i = 0;i < dstPlayer->getBasicEffect().size();i++)
{
if(dstPlayer->getBasicEffect()[i]->getMagicName() == SHIELDCARD||dstPlayer->getBasicEffect().at(i)->getSpecialityList().contains(tr("天使之墙")))
{
coder.shieldNotic(dst);
dstPlayer->removeBasicEffect(dstPlayer->getBasicEffect()[i]);
shieldBlocked = true;
break;
}
}
if(shieldBlocked)
break;
Harm missileHurt;
missileHurt.harmPoint = missilePoint;
missileHurt.type = MAGIC;
//无圣盾,造成伤害
this->timeLine3(missileHurt,getPlayerByID(src),dstPlayer,"魔弹");
break;
}
else if(reply.reply == 802)
{
//继续传递
src = dst;
dst = reply.dstID;
missilePoint++;
cards << getCardByID(reply.CardID);
useCard(cards,getPlayerByID(src),getPlayerByID(dst));
coder.notice("魔导师发动【魔弹融合】");
continue;
}
}while(1);
}