CvHomelandAI::ExecuteMerchantMoves()
- Defined in
- CvHomelandAI.cpp, line 3870
- Class
- CvHomelandAI
- Hook name
CivHooks::CvHomelandAI_ExecuteMerchantMoves
Hooks
static bool BeforeCvHomelandAI_ExecuteMerchantMoves(CvHomelandAI* self);static void AfterCvHomelandAI_ExecuteMerchantMoves(CvHomelandAI* self);static void ReplaceCvHomelandAI_ExecuteMerchantMoves(void (*original)(CvHomelandAI*), CvHomelandAI* self);CivRegisterBefore<CivHooks::CvHomelandAI_ExecuteMerchantMoves>(host, &BeforeCvHomelandAI_ExecuteMerchantMoves);CivRegisterAfter<CivHooks::CvHomelandAI_ExecuteMerchantMoves>(host, &AfterCvHomelandAI_ExecuteMerchantMoves);CivRegisterReplace<CivHooks::CvHomelandAI_ExecuteMerchantMoves>(host, &ReplaceCvHomelandAI_ExecuteMerchantMoves);
Code
3870void CvHomelandAI::ExecuteMerchantMoves()3871{3872 FStaticVector< CvHomelandUnit, 64, true, c_eCiv5GameplayDLL >::iterator it;3873 for(it = m_CurrentMoveUnits.begin(); it != m_CurrentMoveUnits.end(); ++it)3874 {3875 UnitHandle pUnit = m_pPlayer->getUnit(it->GetID());3876 if(!pUnit)3877 {3878 continue;3879 }38803881 GreatPeopleDirectiveTypes eDirective = pUnit->GetGreatPeopleDirective();3882 switch(eDirective)3883 {3884 case GREAT_PEOPLE_DIRECTIVE_GOLDEN_AGE:3885 ExecuteGoldenAgeMove(pUnit.pointer());3886 break;3887 case GREAT_PEOPLE_DIRECTIVE_USE_POWER:3888 // handled by economic AI3889 break;3890 case GREAT_PEOPLE_DIRECTIVE_CONSTRUCT_IMPROVEMENT:3891 ExecuteWorkerMove(pUnit.pointer());3892 break;3893 case NO_GREAT_PEOPLE_DIRECTIVE_TYPE:3894 MoveCivilianToSafety(pUnit.pointer());3895 break;3896 }3897 }3898}
Calls
BaseVector::beginBaseVector::end- CvHomelandAI::ExecuteGoldenAgeMove(CvUnit *)
- CvHomelandAI::ExecuteWorkerMove(CvUnit *, bool)
- CvHomelandAI::MoveCivilianToSafety(CvUnit *, bool, bool)
- CvHomelandUnit::GetID() const
- CvPlayer::getUnit(int)
- CvUnit::GetGreatPeopleDirective() const
FObjectHandle::FObjectHandleFObjectHandle::operator!FObjectHandle::operator->FObjectHandle::pointer