Bazaar developer reference

CvCity::getProductionTurnsLeft(ProjectTypes, int) const

Defined in
CvCity.cpp, line 4883
Class
CvCity
Hook name
CivHooks::CvCity_getProductionTurnsLeft_with_ProjectTypes_int_const

Hooks

static bool BeforeCvCity_getProductionTurnsLeft_with_ProjectTypes_int_const(const CvCity* self, ProjectTypes eProject, int iNum, int& result);static void AfterCvCity_getProductionTurnsLeft_with_ProjectTypes_int_const(const CvCity* self, ProjectTypes eProject, int iNum, int& result);static int ReplaceCvCity_getProductionTurnsLeft_with_ProjectTypes_int_const(int (*original)(const CvCity*, ProjectTypes, int), const CvCity* self, ProjectTypes eProject, int iNum);CivRegisterBefore<CivHooks::CvCity_getProductionTurnsLeft_with_ProjectTypes_int_const>(host, &BeforeCvCity_getProductionTurnsLeft_with_ProjectTypes_int_const);CivRegisterAfter<CivHooks::CvCity_getProductionTurnsLeft_with_ProjectTypes_int_const>(host, &AfterCvCity_getProductionTurnsLeft_with_ProjectTypes_int_const);CivRegisterReplace<CivHooks::CvCity_getProductionTurnsLeft_with_ProjectTypes_int_const>(host, &ReplaceCvCity_getProductionTurnsLeft_with_ProjectTypes_int_const);

Code

4883int CvCity::getProductionTurnsLeft(ProjectTypes eProject, int iNum) const4884{4885	VALIDATE_OBJECT4886	int iProduction;4887	int iFirstProjectOrder;4888	int iProductionNeeded;4889	int iProductionModifier;48904891	iProduction = 0;48924893	iFirstProjectOrder = getFirstProjectOrder(eProject);48944895	if((iFirstProjectOrder == -1) || (iFirstProjectOrder == iNum))4896	{4897		iProduction += getProjectProductionTimes100(eProject);4898	}48994900	iProductionNeeded = getProductionNeeded(eProject) * 100;4901	iProductionModifier = getProductionModifier(eProject);49024903	return getProductionTurnsLeft(iProductionNeeded, iProduction, getProductionDifferenceTimes100(iProductionNeeded, iProduction, iProductionModifier, false, (iNum == 0)), getProductionDifferenceTimes100(iProductionNeeded, iProduction, iProductionModifier, false, false));4904}

Calls

Called by