Bazaar developer reference

CvCity::getYieldRateTimes100(YieldTypes, bool) const

Defined in
CvCity.cpp, line 10591
Class
CvCity
Hook name
CivHooks::CvCity_getYieldRateTimes100

Hooks

static bool BeforeCvCity_getYieldRateTimes100(const CvCity* self, YieldTypes eIndex, bool bIgnoreTrade, int& result);static void AfterCvCity_getYieldRateTimes100(const CvCity* self, YieldTypes eIndex, bool bIgnoreTrade, int& result);static int ReplaceCvCity_getYieldRateTimes100(int (*original)(const CvCity*, YieldTypes, bool), const CvCity* self, YieldTypes eIndex, bool bIgnoreTrade);CivRegisterBefore<CivHooks::CvCity_getYieldRateTimes100>(host, &BeforeCvCity_getYieldRateTimes100);CivRegisterAfter<CivHooks::CvCity_getYieldRateTimes100>(host, &AfterCvCity_getYieldRateTimes100);CivRegisterReplace<CivHooks::CvCity_getYieldRateTimes100>(host, &ReplaceCvCity_getYieldRateTimes100);

Code

10591int CvCity::getYieldRateTimes100(YieldTypes eIndex, bool bIgnoreTrade) const10592{10593	VALIDATE_OBJECT1059410595	// Resistance - no Science, Gold or Production (Prod handled in ProductionDifference)10596	if(IsResistance() || IsRazing())10597	{10598		if(eIndex == YIELD_GOLD || eIndex == YIELD_SCIENCE)10599		{10600			return 0;10601		}1060210603#if defined(MOD_API_UNIFIED_YIELDS_TOURISM)10604		if(eIndex == YIELD_TOURISM)10605		{10606			return 0;10607		}10608#endif1060910610#if defined(MOD_API_UNIFIED_YIELDS_GOLDEN_AGE)10611		if(eIndex == YIELD_GOLDEN_AGE_POINTS)10612		{10613			return 0;10614		}10615#endif10616	}1061710618	int iProcessYield = 0;1061910620	if(getProductionToYieldModifier(eIndex) != 0)10621	{10622#if defined(MOD_PROCESS_STOCKPILE)10623		// We want to process production to production and call it stockpiling!10624		iProcessYield = getBasicYieldRateTimes100(YIELD_PRODUCTION, false) * getProductionToYieldModifier(eIndex) / 100;10625#else10626		CvAssertMsg(eIndex != YIELD_PRODUCTION, "GAMEPLAY: should not be trying to convert Production into Production via process.");1062710628		iProcessYield = getYieldRateTimes100(YIELD_PRODUCTION, false) * getProductionToYieldModifier(eIndex) / 100;10629#endif10630	}1063110632#if defined(MOD_PROCESS_STOCKPILE)10633	int iYield = getBasicYieldRateTimes100(eIndex, bIgnoreTrade) + iProcessYield;10634	return iYield;10635}

Calls

Called by