Bazaar developer reference

CvGameCulture::GetNumCivsInfluentialForWin() const

Defined in
CvCultureClasses.cpp, line 726
Class
CvGameCulture
Hook name
CivHooks::CvGameCulture_GetNumCivsInfluentialForWin

Hooks

static bool BeforeCvGameCulture_GetNumCivsInfluentialForWin(const CvGameCulture* self, int& result);static void AfterCvGameCulture_GetNumCivsInfluentialForWin(const CvGameCulture* self, int& result);static int ReplaceCvGameCulture_GetNumCivsInfluentialForWin(int (*original)(const CvGameCulture*), const CvGameCulture* self);CivRegisterBefore<CivHooks::CvGameCulture_GetNumCivsInfluentialForWin>(host, &BeforeCvGameCulture_GetNumCivsInfluentialForWin);CivRegisterAfter<CivHooks::CvGameCulture_GetNumCivsInfluentialForWin>(host, &AfterCvGameCulture_GetNumCivsInfluentialForWin);CivRegisterReplace<CivHooks::CvGameCulture_GetNumCivsInfluentialForWin>(host, &ReplaceCvGameCulture_GetNumCivsInfluentialForWin);

Code

725/// How many civs do we need to be influential over to win?726int CvGameCulture::GetNumCivsInfluentialForWin() const727{728	// How many players are alive?729	int iAliveMajors = 0;730	for(int iPlayerLoop = 0; iPlayerLoop < MAX_PLAYERS; iPlayerLoop++)731	{732		CvPlayer &kPlayer = GET_PLAYER((PlayerTypes)iPlayerLoop);733		if (kPlayer.isAlive() && !kPlayer.isMinorCiv() && !kPlayer.isBarbarian())734		{735			iAliveMajors++;736		}737	}738739	return iAliveMajors - 1;  // Don't have to be influential over yourself740}

Calls

Called by