CvCity::getProductionTurnsLeft(ProcessTypes, int) const
- Defined in
- CvCity.cpp, line 4945
- Class
- CvCity
- Hook name
CivHooks::CvCity_getProductionTurnsLeft_with_ProcessTypes_int_const
Hooks
static bool BeforeCvCity_getProductionTurnsLeft_with_ProcessTypes_int_const(const CvCity* self, ProcessTypes eProcess, int arg1, int& result);static void AfterCvCity_getProductionTurnsLeft_with_ProcessTypes_int_const(const CvCity* self, ProcessTypes eProcess, int arg1, int& result);static int ReplaceCvCity_getProductionTurnsLeft_with_ProcessTypes_int_const(int (*original)(const CvCity*, ProcessTypes, int), const CvCity* self, ProcessTypes eProcess, int arg1);CivRegisterBefore<CivHooks::CvCity_getProductionTurnsLeft_with_ProcessTypes_int_const>(host, &BeforeCvCity_getProductionTurnsLeft_with_ProcessTypes_int_const);CivRegisterAfter<CivHooks::CvCity_getProductionTurnsLeft_with_ProcessTypes_int_const>(host, &AfterCvCity_getProductionTurnsLeft_with_ProcessTypes_int_const);CivRegisterReplace<CivHooks::CvCity_getProductionTurnsLeft_with_ProcessTypes_int_const>(host, &ReplaceCvCity_getProductionTurnsLeft_with_ProcessTypes_int_const);
Code
4945int CvCity::getProductionTurnsLeft(ProcessTypes eProcess, int) const4946{4947 VALIDATE_OBJECT49484949 if (eProcess == GC.getInfoTypeForString("PROCESS_STOCKPILE")) {4950 int iProduction = getOverflowProduction();4951 int iProductionNeeded = GET_PLAYER(getOwner()).getMaxStockpile();4952 int iProductionModifier = getProductionModifier(eProcess);4953 int iProductionDifference = getProductionDifference(iProductionNeeded, iProduction, iProductionModifier, false, false);49544955 return getProductionTurnsLeft(iProductionNeeded, iProduction, iProductionDifference, iProductionDifference);4956 }49574958 return INT_MAX;4959}
Calls
- CvCity::getOverflowProduction() const
- CvCity::getOwner() const
- CvCity::getProductionDifference(int, int, int, bool, bool) const
- CvCity::getProductionModifier(ProcessTypes, CvString *) const
- CvCity::getProductionTurnsLeft(int, int, int, int) const
- CvGlobals::getInfoTypeForString(const char *, bool) const
- CvPlayer::getMaxStockpile() const
- CvPlayerAI::getPlayer(PlayerTypes)