CvArmyAI::GetNumSlotsFilled() const
- Defined in
- CvArmyAI.cpp, line 376
- Class
- CvArmyAI
- Hook name
CivHooks::CvArmyAI_GetNumSlotsFilled
Hooks
static bool BeforeCvArmyAI_GetNumSlotsFilled(const CvArmyAI* self, int& result);static void AfterCvArmyAI_GetNumSlotsFilled(const CvArmyAI* self, int& result);static int ReplaceCvArmyAI_GetNumSlotsFilled(int (*original)(const CvArmyAI*), const CvArmyAI* self);CivRegisterBefore<CivHooks::CvArmyAI_GetNumSlotsFilled>(host, &BeforeCvArmyAI_GetNumSlotsFilled);CivRegisterAfter<CivHooks::CvArmyAI_GetNumSlotsFilled>(host, &AfterCvArmyAI_GetNumSlotsFilled);CivRegisterReplace<CivHooks::CvArmyAI_GetNumSlotsFilled>(host, &ReplaceCvArmyAI_GetNumSlotsFilled);
Code
375/// How many slots do we currently have filled?376int CvArmyAI::GetNumSlotsFilled() const377{378 int iRtnValue = 0;379380 for(unsigned int iI = 0; iI < m_FormationEntries.size(); iI++)381 {382 if(m_FormationEntries[iI].m_iUnitID != ARMY_NO_UNIT)383 {384 iRtnValue++;385 }386 }387 return iRtnValue;388}
Calls
BaseVector::operator[]BaseVector::size
Called by
- CvAIEscortedOperation::Init(int, PlayerTypes, PlayerTypes, int, CvCity *, CvCity *)
- CvAIOperation::CheckOnTarget()
- CvAIOperation::GetGatherTolerance(CvArmyAI *, CvPlot *) const
- CvAIOperation::LogOperationStart()
- CvAIOperation::UnitWasRemoved(int, int)
- CvAIOperationFoundCity::Init(int, PlayerTypes, PlayerTypes, int, CvCity *, CvCity *)
- CvAIOperationFoundCity::ShouldAbort()
- CvArmyAI::DoDelayedDeath()
- CvTacticalAI::PlotSingleHexOperationMoves(CvAIEscortedOperation *)