Bazaar developer reference

CvGame::countMajorCivsAlive() const

Defined in
CvGame.cpp, line 3989
Class
CvGame
Hook name
CivHooks::CvGame_countMajorCivsAlive

Hooks

static bool BeforeCvGame_countMajorCivsAlive(const CvGame* self, int& result);static void AfterCvGame_countMajorCivsAlive(const CvGame* self, int& result);static int ReplaceCvGame_countMajorCivsAlive(int (*original)(const CvGame*), const CvGame* self);CivRegisterBefore<CivHooks::CvGame_countMajorCivsAlive>(host, &BeforeCvGame_countMajorCivsAlive);CivRegisterAfter<CivHooks::CvGame_countMajorCivsAlive>(host, &AfterCvGame_countMajorCivsAlive);CivRegisterReplace<CivHooks::CvGame_countMajorCivsAlive>(host, &ReplaceCvGame_countMajorCivsAlive);

Code

3989int CvGame::countMajorCivsAlive() const3990{3991	int iCount;3992	int iI;39933994	iCount = 0;39953996	for(iI = 0; iI < MAX_CIV_PLAYERS; iI++)3997	{3998		if(GET_PLAYER((PlayerTypes)iI).isAlive())3999		{4000			if(!GET_PLAYER((PlayerTypes)iI).isMinorCiv())4001			{4002				iCount++;4003			}4004		}4005	}40064007	return iCount;4008}

Calls

Called by