CvPlayerEspionage::GetNumAssignedSpies()
- Defined in
- CvEspionageClasses.cpp, line 2605
- Class
- CvPlayerEspionage
- Hook name
CivHooks::CvPlayerEspionage_GetNumAssignedSpies
Hooks
static bool BeforeCvPlayerEspionage_GetNumAssignedSpies(CvPlayerEspionage* self, int& result);static void AfterCvPlayerEspionage_GetNumAssignedSpies(CvPlayerEspionage* self, int& result);static int ReplaceCvPlayerEspionage_GetNumAssignedSpies(int (*original)(CvPlayerEspionage*), CvPlayerEspionage* self);CivRegisterBefore<CivHooks::CvPlayerEspionage_GetNumAssignedSpies>(host, &BeforeCvPlayerEspionage_GetNumAssignedSpies);CivRegisterAfter<CivHooks::CvPlayerEspionage_GetNumAssignedSpies>(host, &AfterCvPlayerEspionage_GetNumAssignedSpies);CivRegisterReplace<CivHooks::CvPlayerEspionage_GetNumAssignedSpies>(host, &ReplaceCvPlayerEspionage_GetNumAssignedSpies);
Code
2604/// GetNumAssignedSpies - Number of spies that the player has assigned to tasks2605int CvPlayerEspionage::GetNumAssignedSpies(void)2606{2607 int iCount = 0;2608 for(uint ui = 0; ui < m_aSpyList.size(); ui++)2609 {2610#if defined(MOD_API_ESPIONAGE)2611 if(m_aSpyList[ui].m_eSpyState == SPY_STATE_DEAD || m_aSpyList[ui].m_eSpyState == SPY_STATE_TERMINATED)2612#else2613 if(m_aSpyList[ui].m_eSpyState == SPY_STATE_DEAD)2614#endif2615 {2616 continue;2617 }26182619 if(IsSpyInCity(ui))2620 {2621 iCount++;2622 }2623 }26242625 return iCount;2626}
Calls
BaseVector::operator[]BaseVector::size- CvPlayerEspionage::IsSpyInCity(uint)