Bazaar developer reference

CvTeam::getDefensivePactCount(TeamTypes) const

Defined in
CvTeam.cpp, line 2247
Class
CvTeam
Hook name
CivHooks::CvTeam_getDefensivePactCount

Hooks

static bool BeforeCvTeam_getDefensivePactCount(const CvTeam* self, TeamTypes eTeam, int& result);static void AfterCvTeam_getDefensivePactCount(const CvTeam* self, TeamTypes eTeam, int& result);static int ReplaceCvTeam_getDefensivePactCount(int (*original)(const CvTeam*, TeamTypes), const CvTeam* self, TeamTypes eTeam);CivRegisterBefore<CivHooks::CvTeam_getDefensivePactCount>(host, &BeforeCvTeam_getDefensivePactCount);CivRegisterAfter<CivHooks::CvTeam_getDefensivePactCount>(host, &AfterCvTeam_getDefensivePactCount);CivRegisterReplace<CivHooks::CvTeam_getDefensivePactCount>(host, &ReplaceCvTeam_getDefensivePactCount);

Code

2247int CvTeam::getDefensivePactCount(TeamTypes eTeam) const2248{2249	int iCount;2250	int iI;22512252	iCount = 0;22532254	for(iI = 0; iI < MAX_CIV_TEAMS; iI++)2255	{2256		if(GET_TEAM((TeamTypes)iI).isAlive())2257		{2258			if(iI != m_eID)2259			{2260				if(IsHasDefensivePact((TeamTypes)iI))2261				{2262					if(NO_TEAM == eTeam || GET_TEAM(eTeam).isHasMet((TeamTypes)iI))2263					{2264						iCount++;2265					}2266				}2267			}2268		}2269	}22702271	return iCount;2272}

Calls

Called by