Bazaar developer reference

CvEconomicAI::StartSaveForPurchase(PurchaseType, int, int)

Defined in
CvEconomicAI.cpp, line 1136
Class
CvEconomicAI
Hook name
CivHooks::CvEconomicAI_StartSaveForPurchase

Hooks

static bool BeforeCvEconomicAI_StartSaveForPurchase(CvEconomicAI* self, PurchaseType ePurchase, int iAmount, int iPriority);static void AfterCvEconomicAI_StartSaveForPurchase(CvEconomicAI* self, PurchaseType ePurchase, int iAmount, int iPriority);static void ReplaceCvEconomicAI_StartSaveForPurchase(void (*original)(CvEconomicAI*, PurchaseType, int, int), CvEconomicAI* self, PurchaseType ePurchase, int iAmount, int iPriority);// CivHooks.h gives this hook point no types, so nothing checks these hooks' parameters.host->RegisterHook(host->pluginIndex, CivHooks::CvEconomicAI_StartSaveForPurchase::ID, CIV_HOOK_BEFORE, (void*)&BeforeCvEconomicAI_StartSaveForPurchase);host->RegisterHook(host->pluginIndex, CivHooks::CvEconomicAI_StartSaveForPurchase::ID, CIV_HOOK_AFTER, (void*)&AfterCvEconomicAI_StartSaveForPurchase);host->RegisterHook(host->pluginIndex, CivHooks::CvEconomicAI_StartSaveForPurchase::ID, CIV_HOOK_REPLACE, (void*)&ReplaceCvEconomicAI_StartSaveForPurchase);

Code

1135/// Request that the AI set aside this much money1136void CvEconomicAI::StartSaveForPurchase(PurchaseType ePurchase, int iAmount, int iPriority)1137{1138	int iIndex = (int)ePurchase;1139	CvPurchaseRequest request;1140	request.m_eType = ePurchase;1141	request.m_iAmount = iAmount;1142	request.m_iPriority = iPriority;1143	m_RequestedSavings[iIndex] = request;1144}

Calls

Called by