CvTacticalAI::GetFirstZoneTarget(AITacticalTargetType)
- Defined in
- CvTacticalAI.cpp, line 6140
- Class
- CvTacticalAI
- Hook name
CivHooks::CvTacticalAI_GetFirstZoneTarget
Hooks
static bool BeforeCvTacticalAI_GetFirstZoneTarget(CvTacticalAI* self, AITacticalTargetType eType, CvTacticalTarget*& result);static void AfterCvTacticalAI_GetFirstZoneTarget(CvTacticalAI* self, AITacticalTargetType eType, CvTacticalTarget*& result);static CvTacticalTarget* ReplaceCvTacticalAI_GetFirstZoneTarget(CvTacticalTarget* (*original)(CvTacticalAI*, AITacticalTargetType), CvTacticalAI* self, AITacticalTargetType eType);CivRegisterBefore<CivHooks::CvTacticalAI_GetFirstZoneTarget>(host, &BeforeCvTacticalAI_GetFirstZoneTarget);CivRegisterAfter<CivHooks::CvTacticalAI_GetFirstZoneTarget>(host, &AfterCvTacticalAI_GetFirstZoneTarget);CivRegisterReplace<CivHooks::CvTacticalAI_GetFirstZoneTarget>(host, &ReplaceCvTacticalAI_GetFirstZoneTarget);
Code
6139/// Find the first target of a requested type in current dominance zone (call after ExtractTargetsForZone())6140CvTacticalTarget* CvTacticalAI::GetFirstZoneTarget(AITacticalTargetType eType)6141{6142 m_eCurrentTargetType = eType;6143 m_iCurrentTargetIndex = 0;61446145 while(m_iCurrentTargetIndex < (int)m_ZoneTargets.size())6146 {6147 if(m_eCurrentTargetType == AI_TACTICAL_TARGET_NONE || m_ZoneTargets[m_iCurrentTargetIndex].GetTargetType() == m_eCurrentTargetType)6148 {6149 return &m_ZoneTargets[m_iCurrentTargetIndex];6150 }6151 m_iCurrentTargetIndex++;6152 }61536154 return NULL;6155}
Calls
BaseVector::operator[]BaseVector::size- CvTacticalTarget::GetTargetType()
Called by
- CvTacticalAI::FindBestBarbarianSeaMove(UnitHandle)
- CvTacticalAI::PlotAncientRuinMoves(int)
- CvTacticalAI::PlotBarbarianCampMoves()
- CvTacticalAI::PlotBarbarianPlunderTradeUnitMove(DomainTypes)
- CvTacticalAI::PlotBastionMoves(int)
- CvTacticalAI::PlotBlockadeImprovementMoves()
- CvTacticalAI::PlotCampDefenseMoves()
- CvTacticalAI::PlotCaptureCityMoves()
- CvTacticalAI::PlotCivilianAttackMoves(AITacticalTargetType)
- CvTacticalAI::PlotDamageCityMoves()
- CvTacticalAI::PlotDestroyUnitMoves(AITacticalTargetType, bool, bool)
- CvTacticalAI::PlotGarrisonMoves(int, bool)
- CvTacticalAI::PlotGuardImprovementMoves(int)
- CvTacticalAI::PlotPillageMoves(AITacticalTargetType, bool)
- CvTacticalAI::PlotPlunderTradePlotMoves(DomainTypes)
- CvTacticalAI::PlotPlunderTradeUnitMoves(DomainTypes)
- CvTacticalAI::PlotSafeBombardMoves()