Bazaar developer reference

CvGame::countTotalCivPower()

Defined in
CvGame.cpp, line 4033
Class
CvGame
Hook name
CivHooks::CvGame_countTotalCivPower

Hooks

static bool BeforeCvGame_countTotalCivPower(CvGame* self, int& result);static void AfterCvGame_countTotalCivPower(CvGame* self, int& result);static int ReplaceCvGame_countTotalCivPower(int (*original)(CvGame*), CvGame* self);CivRegisterBefore<CivHooks::CvGame_countTotalCivPower>(host, &BeforeCvGame_countTotalCivPower);CivRegisterAfter<CivHooks::CvGame_countTotalCivPower>(host, &AfterCvGame_countTotalCivPower);CivRegisterReplace<CivHooks::CvGame_countTotalCivPower>(host, &ReplaceCvGame_countTotalCivPower);

Code

4033int CvGame::countTotalCivPower()4034{4035	int iCount;4036	int iI;40374038	iCount = 0;40394040	for(iI = 0; iI < MAX_CIV_PLAYERS; iI++)4041	{4042		if(GET_PLAYER((PlayerTypes)iI).isAlive())4043		{4044			iCount += GET_PLAYER((PlayerTypes)iI).getPower();4045		}4046	}40474048	return iCount;4049}

Calls

Called by