int CvCity::getGlobalReligionYield(YieldTypes eIndex) const
{
FAssertMsg(eIndex >= 0, "eIndex expected to be >= 0");
FAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES");
return m_aiGlobalReligionYield[eIndex];
}
int CvCity::getGlobalReligionYieldByReligion(YieldTypes eIndex, ReligionTypes eReligion) const
{
int iYield;
FAssertMsg(eIndex >= 0, "eIndex expected to be >= 0");
FAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES");
FAssertMsg(eReligion >= 0, "eReligion expected to be >= 0");
FAssertMsg(eReligion < GC.getNumReligionInfos(), "GC.getNumReligionInfos expected to be >= 0");
iYield = 0;
if bHasShrine = true
{
iYield += GC.getReligionInfo(eReligion).getGlobalReligionYield(eIndex);
}
return iYield;
}
void CvCity::updateGlobalReligionYield(YieldTypes eIndex)
{
int iOldYield = getGlobalReligionYield(eIndex);
int iNewYield = 0;
for (int iI = 0; iI < GC.getNumReligionInfos(); iI++)
{
iNewYield += getGlobalReligionYieldByReligion(eIndex, (ReligionTypes)iI);
}
if (iOldYield != iNewYield)
{
m_aiGlobalReligionYield[eIndex] = iNewYield;
FAssert(getGlobalReligionYield(eIndex) >= 0);
changeBaseYieldRate(eIndex, (iNewYield - iOldYield));
}
}
void CvCity::updateGlobalReligionYield()
{
int iI;
for (iI = 0; iI < NUM_YIELD_TYPES; iI++)
{
updateGlobalReligionYield((YieldTypes)iI);
}
}