本文整理汇总了C++中CvPlot::isVisibleOtherUnit方法的典型用法代码示例。如果您正苦于以下问题:C++ CvPlot::isVisibleOtherUnit方法的具体用法?C++ CvPlot::isVisibleOtherUnit怎么用?C++ CvPlot::isVisibleOtherUnit使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CvPlot
的用法示例。
在下文中一共展示了CvPlot::isVisibleOtherUnit方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ShouldIgnoreUnit
/// Should this unit be ignored when creating the danger plots?
bool CvDangerPlots::ShouldIgnoreUnit (CvUnit* pUnit, bool bIgnoreVisibility)
{
if (!pUnit->IsCanAttack())
{
return true;
}
if (!pUnit->plot()->isVisible(GET_PLAYER(m_ePlayer).getTeam()))
{
return true;
}
if (pUnit->isInvisible(GET_PLAYER(m_ePlayer).getTeam(), false))
{
return true;
}
CvPlot* pPlot = pUnit->plot();
CvAssertMsg(pPlot, "Plot is null?")
if (pPlot && !pPlot->isVisibleOtherUnit(m_ePlayer) && !bIgnoreVisibility)
{
return true;
}
// fix post-gold!
if (pUnit->getDomainType() == DOMAIN_AIR)
{
return true;
}
return false;
}
示例2: ShouldIgnoreUnit
/// Should this unit be ignored when creating the danger plots?
bool CvDangerPlots::ShouldIgnoreUnit(CvUnit* pUnit, bool bIgnoreVisibility)
{
if(!m_bArrayAllocated || m_ePlayer==NO_PLAYER)
return true;
if(!pUnit->IsCanAttack())
{
return true;
}
#if defined(AUI_DANGER_PLOTS_SHOULD_IGNORE_UNIT_MAJORS_SEE_BARBARIANS_IN_FOG) || defined(AUI_DANGER_PLOTS_SHOULD_IGNORE_UNIT_MINORS_SEE_MAJORS)
if (pUnit->isInvisible(GET_PLAYER(m_ePlayer).getTeam(), false))
{
return true;
}
#endif // AUI_DANGER_PLOTS_SHOULD_IGNORE_UNIT_MAJORS_SEE_BARBARIANS_IN_FOG
if (pUnit->getDomainType() == DOMAIN_AIR)
{
return true;
}
#ifdef AUI_DANGER_PLOTS_SHOULD_IGNORE_UNIT_MAJORS_SEE_BARBARIANS_IN_FOG
if (!GET_PLAYER(m_ePlayer).isMinorCiv() && !GET_PLAYER(m_ePlayer).isBarbarian() && pUnit->isBarbarian() && pUnit->plot()->isRevealed(GET_PLAYER(m_ePlayer).getTeam()))
if (pUnit->plot()->isAdjacentVisible(GET_PLAYER(m_ePlayer).getTeam()))
bIgnoreVisibility = true;
#endif // AUI_DANGER_PLOTS_SHOULD_IGNORE_UNIT_MAJORS_SEE_BARBARIANS_IN_FOG
#ifdef AUI_DANGER_PLOTS_SHOULD_IGNORE_UNIT_MINORS_SEE_MAJORS
if (GET_PLAYER(m_ePlayer).isMinorCiv() && !GET_PLAYER(pUnit->getOwner()).isMinorCiv() && !pUnit->isBarbarian() &&
GET_PLAYER(m_ePlayer).GetClosestCity(pUnit->plot(), AUI_DANGER_PLOTS_SHOULD_IGNORE_UNIT_MINORS_SEE_MAJORS, true))
bIgnoreVisibility = true;
#endif // AUI_DANGER_PLOTS_SHOULD_IGNORE_UNIT_MINORS_SEE_MAJORS
if(!pUnit->plot()->isVisible(GET_PLAYER(m_ePlayer).getTeam()) && !bIgnoreVisibility)
{
return true;
}
#if !defined(AUI_DANGER_PLOTS_SHOULD_IGNORE_UNIT_MAJORS_SEE_BARBARIANS_IN_FOG) && !defined(AUI_DANGER_PLOTS_SHOULD_IGNORE_UNIT_MINORS_SEE_MAJORS)
if(pUnit->isInvisible(GET_PLAYER(m_ePlayer).getTeam(), false))
{
return true;
}
#endif // AUI_DANGER_PLOTS_SHOULD_IGNORE_UNIT_MAJORS_SEE_BARBARIANS_IN_FOG
CvPlot* pPlot = pUnit->plot();
CvAssertMsg(pPlot, "Plot is null?")
if(NULL != pPlot && !pPlot->isVisibleOtherUnit(m_ePlayer) && !bIgnoreVisibility)
{
return true;
}
return false;
}