CvPlot::getVisibleEnemyDefender(PlayerTypes)
- Defined in
- CvPlot.cpp, line 3955
- Class
- CvPlot
- Hook name
CivHooks::CvPlot_getVisibleEnemyDefender
Hooks
static bool BeforeCvPlot_getVisibleEnemyDefender(CvPlot* self, PlayerTypes ePlayer, CvUnit*& result);static void AfterCvPlot_getVisibleEnemyDefender(CvPlot* self, PlayerTypes ePlayer, CvUnit*& result);static CvUnit* ReplaceCvPlot_getVisibleEnemyDefender(CvUnit* (*original)(CvPlot*, PlayerTypes), CvPlot* self, PlayerTypes ePlayer);CivRegisterBefore<CivHooks::CvPlot_getVisibleEnemyDefender>(host, &BeforeCvPlot_getVisibleEnemyDefender);CivRegisterAfter<CivHooks::CvPlot_getVisibleEnemyDefender>(host, &AfterCvPlot_getVisibleEnemyDefender);CivRegisterReplace<CivHooks::CvPlot_getVisibleEnemyDefender>(host, &ReplaceCvPlot_getVisibleEnemyDefender);
Code
3955CvUnit* CvPlot::getVisibleEnemyDefender(PlayerTypes ePlayer)3956{3957 const IDInfo* pUnitNode = m_units.head();3958 if(pUnitNode)3959 {3960 TeamTypes eTeam = GET_PLAYER(ePlayer).getTeam();3961 do3962 {3963 const CvUnit* pLoopUnit = GetPlayerUnit(*pUnitNode);3964 pUnitNode = m_units.next(pUnitNode);39653966 if(pLoopUnit && !pLoopUnit->isInvisible(eTeam, false))3967 {3968 if(pLoopUnit->IsCanDefend() && isEnemy(pLoopUnit, eTeam, false))3969 {3970 return const_cast<CvUnit*>(pLoopUnit);3971 }3972 }3973 }3974 while(pUnitNode != NULL);3975 }39763977 return NULL;3978}
Calls
Called by
- CvAIOperationNavalBombardment::FindBestTarget()
- AttackPathDestEval(int, int, const void *, CvAStar *, bool, bool)
- CvCity::IsBlockaded() const
- CvPlayer::doWarnings()
- CvPlot::isBlockaded(PlayerTypes)
- CvTacticalAI::ClearEnemiesNearArmy(CvArmyAI *)
- CvTacticalAI::ComputeTotalExpectedDamage(CvTacticalTarget *, CvPlot *)
- CvTacticalAI::ExecuteFlankAttack(CvTacticalTarget &)
- CvTacticalAI::ExecuteMoveOfBlockingUnit(UnitHandle)
- CvTacticalAI::ExecuteSafeBombards(CvTacticalTarget &)
- CvTacticalAI::FindTacticalTargets()
- CvTacticalAI::IdentifyPriorityBarbarianTargets()
- CvTacticalAI::IdentifyPriorityTargets()
- CvTacticalAI::PlotDestroyUnitMoves(AITacticalTargetType, bool, bool)
- CvTacticalTarget::IsTargetStillAlive(PlayerTypes)
- CvGameTrade::StepUnit(int)
- CvUnit::SentryAlert(bool) const
- CvUnitMission::ContinueMission(UnitHandle, int, int)