Bazaar developer reference

CvGame::getNumSequentialHumans(PlayerTypes)

Defined in
CvGame.cpp, line 4427
Class
CvGame
Hook name
CivHooks::CvGame_getNumSequentialHumans

Hooks

static bool BeforeCvGame_getNumSequentialHumans(CvGame* self, PlayerTypes ignorePlayer, int& result);static void AfterCvGame_getNumSequentialHumans(CvGame* self, PlayerTypes ignorePlayer, int& result);static int ReplaceCvGame_getNumSequentialHumans(int (*original)(CvGame*, PlayerTypes), CvGame* self, PlayerTypes ignorePlayer);CivRegisterBefore<CivHooks::CvGame_getNumSequentialHumans>(host, &BeforeCvGame_getNumSequentialHumans);CivRegisterAfter<CivHooks::CvGame_getNumSequentialHumans>(host, &AfterCvGame_getNumSequentialHumans);CivRegisterReplace<CivHooks::CvGame_getNumSequentialHumans>(host, &ReplaceCvGame_getNumSequentialHumans);

Code

4427int CvGame::getNumSequentialHumans(PlayerTypes ignorePlayer)4428{//returns the number of human players who are playing sequential turns.4429	int seqHumans = 0;4430	for(int i = 0; i < MAX_CIV_PLAYERS; ++i)4431	{4432		const CvPlayer& curPlayer = GET_PLAYER((PlayerTypes)i);4433		if(curPlayer.isAlive() 4434			&& curPlayer.isHuman() 4435			&& !curPlayer.isSimultaneousTurns()4436			&& (ignorePlayer == NO_PLAYER || curPlayer.GetID() != ignorePlayer))  //ignore the ignore player4437		{4438			++seqHumans;4439		}4440	}4441	return seqHumans;4442}

Calls

Called by