Bazaar developer reference

CvCity::GetPurchaseCost(ProjectTypes)

Defined in
CvCity.cpp, line 5318
Class
CvCity
Hook name
CivHooks::CvCity_GetPurchaseCost_with_ProjectTypes

Hooks

static bool BeforeCvCity_GetPurchaseCost_with_ProjectTypes(CvCity* self, ProjectTypes eProject, int& result);static void AfterCvCity_GetPurchaseCost_with_ProjectTypes(CvCity* self, ProjectTypes eProject, int& result);static int ReplaceCvCity_GetPurchaseCost_with_ProjectTypes(int (*original)(CvCity*, ProjectTypes), CvCity* self, ProjectTypes eProject);CivRegisterBefore<CivHooks::CvCity_GetPurchaseCost_with_ProjectTypes>(host, &BeforeCvCity_GetPurchaseCost_with_ProjectTypes);CivRegisterAfter<CivHooks::CvCity_GetPurchaseCost_with_ProjectTypes>(host, &AfterCvCity_GetPurchaseCost_with_ProjectTypes);CivRegisterReplace<CivHooks::CvCity_GetPurchaseCost_with_ProjectTypes>(host, &ReplaceCvCity_GetPurchaseCost_with_ProjectTypes);

Code

5318int CvCity::GetPurchaseCost(ProjectTypes eProject)5319{5320	VALIDATE_OBJECT53215322	int iCost = GetPurchaseCostFromProduction(getProductionNeeded(eProject));53235324	// Make the number not be funky5325	int iDivisor = /*10*/ GC.getGOLD_PURCHASE_VISIBLE_DIVISOR();5326	iCost /= iDivisor;5327	iCost *= iDivisor;53285329	return iCost;5330}

Calls

Called by