Bazaar developer reference

CvCity::getProductionExperience(UnitTypes)

Defined in
CvCity.cpp, line 3983
Class
CvCity
Hook name
CivHooks::CvCity_getProductionExperience

Hooks

static bool BeforeCvCity_getProductionExperience(CvCity* self, UnitTypes eUnit, int& result);static void AfterCvCity_getProductionExperience(CvCity* self, UnitTypes eUnit, int& result);static int ReplaceCvCity_getProductionExperience(int (*original)(CvCity*, UnitTypes), CvCity* self, UnitTypes eUnit);CivRegisterBefore<CivHooks::CvCity_getProductionExperience>(host, &BeforeCvCity_getProductionExperience);CivRegisterAfter<CivHooks::CvCity_getProductionExperience>(host, &AfterCvCity_getProductionExperience);CivRegisterReplace<CivHooks::CvCity_getProductionExperience>(host, &ReplaceCvCity_getProductionExperience);

Code

3983int CvCity::getProductionExperience(UnitTypes eUnit)3984{3985	VALIDATE_OBJECT3986	int iExperience;39873988	CvPlayerAI& kOwner = GET_PLAYER(getOwner());39893990	iExperience = getFreeExperience();3991	iExperience += kOwner.getFreeExperience();39923993	if(eUnit != NO_UNIT)3994	{3995		CvUnitEntry* pkUnitInfo = GC.getUnitInfo(eUnit);3996		if(pkUnitInfo)3997		{3998			if(pkUnitInfo->GetUnitCombatType() != NO_UNITCOMBAT)3999			{4000				iExperience += getUnitCombatFreeExperience((UnitCombatTypes)(pkUnitInfo->GetUnitCombatType()));4001				iExperience += kOwner.getUnitCombatFreeExperiences((UnitCombatTypes) pkUnitInfo->GetUnitCombatType());4002			}4003			iExperience += getDomainFreeExperience((DomainTypes)(pkUnitInfo->GetDomainType()));4004			iExperience += getDomainFreeExperienceFromGreatWorks((DomainTypes)(pkUnitInfo->GetDomainType()));40054006			iExperience += getSpecialistFreeExperience();4007		}4008	}40094010	return std::max(0, iExperience);4011}

Calls

Called by