本文整理汇总了C++中CvCity::isHasReligion方法的典型用法代码示例。如果您正苦于以下问题:C++ CvCity::isHasReligion方法的具体用法?C++ CvCity::isHasReligion怎么用?C++ CvCity::isHasReligion使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CvCity
的用法示例。
在下文中一共展示了CvCity::isHasReligion方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: operator
bool operator() (const UnitInfo::ReligionNode& node) const
{
if (node.prereqReligion != NO_RELIGION)
{
CityIter cityIter(*player_.getCvPlayer());
CvCity* pCity;
while (pCity = cityIter())
{
if (pCity->isHasReligion(node.prereqReligion))
{
return true;
}
}
}
return node.prereqReligion == NO_RELIGION;
}
示例2: hasGOM
//.........这里部分代码省略.........
break;
}
case GOM_ROUTE:
{
// Check route type
RouteTypes eRoute = (RouteTypes) iID;
return m_pPlot->getRouteType() == eRoute;
break;
}
case GOM_BONUS:
{
// Check bonus type
BonusTypes eBonus = (BonusTypes) iID;
return m_pPlot->getBonusType() == eBonus;
break;
}
case GOM_UNITTYPE:
{
// Defer to units on the plot, combine with OR
bool bHasGOM = false;
foreach(GAMEOBJECT_UNIT, boost::bind(aggregateHasGOM, _1, eType, iID, &bHasGOM));
return bHasGOM;
break;
}
case GOM_TECH:
{
// If the team has researched that tech, return true
TechTypes eTech = (TechTypes) iID;
TeamTypes eTeam = m_pPlot->getTeam();
if (eTeam != NO_TEAM)
{
return GET_TEAM(eTeam).isHasTech(eTech);
}
else
{
return false;
}
break;
}
case GOM_CIVIC:
{
// Return true if the owning player has the civic active
CivicTypes eCivic = (CivicTypes) iID;
PlayerTypes ePlayer = m_pPlot->getOwnerINLINE();
if (ePlayer != NO_PLAYER)
{
return GET_PLAYER(ePlayer).isCivic(eCivic);
}
else
{
return false;
}
break;
}
case GOM_RELIGION:
{
// return true if the religion is present in the city on this plot
CvCity* pCity = m_pPlot->getPlotCity();
if (pCity)
{
return pCity->isHasReligion((ReligionTypes)iID);
}
else
{
return false;
}
break;
}
case GOM_CORPORATION:
{
// return true if the corporation is present in the city on this plot
CvCity* pCity = m_pPlot->getPlotCity();
if (pCity)
{
return pCity->isHasCorporation((CorporationTypes)iID);
}
else
{
return false;
}
break;
}
case GOM_IMPROVEMENT:
{
// Check improvement type
ImprovementTypes eImprovement = (ImprovementTypes) iID;
return m_pPlot->getImprovementType() == eImprovement;
break;
}
}
return false;
}