本文整理汇总了C++中CvCity::getOwnerINLINE方法的典型用法代码示例。如果您正苦于以下问题:C++ CvCity::getOwnerINLINE方法的具体用法?C++ CvCity::getOwnerINLINE怎么用?C++ CvCity::getOwnerINLINE使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CvCity
的用法示例。
在下文中一共展示了CvCity::getOwnerINLINE方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: changeNumBonuses
void CvPlotGroup::changeNumBonuses(BonusTypes eBonus, int iChange)
{
CLLNode<XYCoords>* pPlotNode;
CvCity* pCity;
int iOldNumBonuses;
FAssertMsg(eBonus >= 0, "eBonus is expected to be non-negative (invalid Index)");
FAssertMsg(eBonus < GC.getNumBonusInfos(), "eBonus is expected to be within maximum bounds (invalid Index)");
if (iChange != 0)
{
iOldNumBonuses = getNumBonuses(eBonus);
m_paiNumBonuses[eBonus] = (m_paiNumBonuses[eBonus] + iChange);
//FAssertMsg(m_paiNumBonuses[eBonus] >= 0, "m_paiNumBonuses[eBonus] is expected to be non-negative (invalid Index)"); XXX
pPlotNode = headPlotsNode();
while (pPlotNode != NULL)
{
pCity = GC.getMapINLINE().plotSorenINLINE(pPlotNode->m_data.iX, pPlotNode->m_data.iY)->getPlotCity();
if (pCity != NULL)
{
if (pCity->getOwnerINLINE() == getOwnerINLINE())
{
pCity->changeNumBonuses(eBonus, iChange);
}
}
pPlotNode = nextPlotsNode(pPlotNode);
}
}
}