CvPlayerAI::CityCommitToBuildUnitForOperationSlot(int, int, CvCity *)
- Defined in
- CvPlayerAI.cpp, line 924
- Class
- CvPlayerAI
- Hook name
CivHooks::CvPlayerAI_CityCommitToBuildUnitForOperationSlot- Overrides
- CvPlayer::CityCommitToBuildUnitForOperationSlot(int, int, CvCity *)
Hooks
static bool BeforeCvPlayerAI_CityCommitToBuildUnitForOperationSlot(CvPlayerAI* self, int iAreaID, int iTurns, CvCity* pCity, OperationSlot& result);static void AfterCvPlayerAI_CityCommitToBuildUnitForOperationSlot(CvPlayerAI* self, int iAreaID, int iTurns, CvCity* pCity, OperationSlot& result);static OperationSlot ReplaceCvPlayerAI_CityCommitToBuildUnitForOperationSlot(OperationSlot (*original)(CvPlayerAI*, int, int, CvCity*), CvPlayerAI* self, int iAreaID, int iTurns, CvCity* pCity);CivRegisterBefore<CivHooks::CvPlayerAI_CityCommitToBuildUnitForOperationSlot>(host, &BeforeCvPlayerAI_CityCommitToBuildUnitForOperationSlot);CivRegisterAfter<CivHooks::CvPlayerAI_CityCommitToBuildUnitForOperationSlot>(host, &AfterCvPlayerAI_CityCommitToBuildUnitForOperationSlot);CivRegisterReplace<CivHooks::CvPlayerAI_CityCommitToBuildUnitForOperationSlot>(host, &ReplaceCvPlayerAI_CityCommitToBuildUnitForOperationSlot);
Code
924OperationSlot CvPlayerAI::CityCommitToBuildUnitForOperationSlot(int iAreaID, int iTurns, CvCity* pCity)925{926 OperationSlot thisSlot;927928 // search through our operations till we find one that needs a unit929 std::map<int, CvAIOperation*>::iterator iter;930 for(iter = m_AIOperations.begin(); iter != m_AIOperations.end(); ++iter)931 {932 CvAIOperation* pThisOperation = iter->second;933 if(pThisOperation)934 {935 thisSlot = pThisOperation->CommitToBuildNextUnit(iAreaID, iTurns, pCity);936 if(thisSlot.IsValid())937 {938 break;939 }940 }941 }942943 return thisSlot;944}
Calls
- CvAIOperation::CommitToBuildNextUnit(int, int, CvCity *)
- OperationSlot::IsValid() const
OperationSlot::OperationSlot- OperationSlot::OperationSlot()
OperationSlot::operator=std::_Tree::beginstd::_Tree::const_iterator::operator!=std::_Tree::endstd::_Tree::iterator::iteratorstd::_Tree::iterator::operator++std::_Tree::iterator::operator->std::_Tree::iterator::operator=