CvGameDeals::DestroyDeal(uint)
- Defined in
- CvDealClasses.cpp, line 4117
- Class
- CvGameDeals
- Hook name
CivHooks::CvGameDeals_DestroyDeal
Hooks
static bool BeforeCvGameDeals_DestroyDeal(CvGameDeals* self, uint index);static void AfterCvGameDeals_DestroyDeal(CvGameDeals* self, uint index);static void ReplaceCvGameDeals_DestroyDeal(void (*original)(CvGameDeals*, uint), CvGameDeals* self, uint index);CivRegisterBefore<CivHooks::CvGameDeals_DestroyDeal>(host, &BeforeCvGameDeals_DestroyDeal);CivRegisterAfter<CivHooks::CvGameDeals_DestroyDeal>(host, &AfterCvGameDeals_DestroyDeal);CivRegisterReplace<CivHooks::CvGameDeals_DestroyDeal>(host, &ReplaceCvGameDeals_DestroyDeal);
Code
4117void CvGameDeals::DestroyDeal(uint index)4118{4119 std::vector<std::pair<uint, CvDeal*> >::iterator it = m_Deals.end();4120 for(it = m_Deals.begin();4121 it != m_Deals.end(); ++it)4122 {4123 if((*it).first == index)4124 break;4125 }41264127 if(it != m_Deals.end())4128 {4129 delete(*it).second;4130 m_Deals.erase(it);4131 }4132}
Calls
std::_Vector_const_iterator::_Vector_const_iteratorstd::_Vector_const_iterator::operator!=std::_Vector_iterator::operator*std::_Vector_iterator::operator++std::_Vector_iterator::operator=std::vector::beginstd::vector::endstd::vector::erase