本文整理汇总了C++中Hexagon::getOwner方法的典型用法代码示例。如果您正苦于以下问题:C++ Hexagon::getOwner方法的具体用法?C++ Hexagon::getOwner怎么用?C++ Hexagon::getOwner使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Hexagon
的用法示例。
在下文中一共展示了Hexagon::getOwner方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: moveTroops
void TroopsMover::moveTroops(Army* army, Hexagon* endHex)
{
// used for achievements and shake
const int armySize = army->getTroopsCount();
const int endHexArmySize = endHex->getTroopsCount();
Hexagon* startHex = army->getCurrentHex();
const int troops = army->getTroopsCount();
startHex->removeArmy(army);
if(troops == 0){
army->free();
return;
}
if(endHex->getOwner() == startHex->getOwner()){
endHex->addArmy(army);
}else{
AttackResult attackResult = getAttackResult(army, endHex);
updateAchievements(army->getCurrentHex()->getOwner(), attackResult, armySize, endHexArmySize, endHex);
handleAttackResult(attackResult, army, startHex, endHex);
if(attackResult == DefenderWins){
if(endHex->getOwner()) EffectPlayer::playAttackEffect();
}
checkAndShake(armySize, endHexArmySize, endHex);
}
if((endHex->getTroopsCount() > 0) && (startHex != endHex)){
endHex->runScaleAction();
}
}