Bazaar developer reference

CvPlayer::CountAllTerrain(TerrainTypes)

Defined in
CvPlayer.cpp, line 28630
Class
CvPlayer
Hook name
CivHooks::CvPlayer_CountAllTerrain

Hooks

static bool BeforeCvPlayer_CountAllTerrain(CvPlayer* self, TerrainTypes iTerrainType, int& result);static void AfterCvPlayer_CountAllTerrain(CvPlayer* self, TerrainTypes iTerrainType, int& result);static int ReplaceCvPlayer_CountAllTerrain(int (*original)(CvPlayer*, TerrainTypes), CvPlayer* self, TerrainTypes iTerrainType);CivRegisterBefore<CivHooks::CvPlayer_CountAllTerrain>(host, &BeforeCvPlayer_CountAllTerrain);CivRegisterAfter<CivHooks::CvPlayer_CountAllTerrain>(host, &AfterCvPlayer_CountAllTerrain);CivRegisterReplace<CivHooks::CvPlayer_CountAllTerrain>(host, &ReplaceCvPlayer_CountAllTerrain);

Code

28630int CvPlayer::CountAllTerrain(TerrainTypes iTerrainType)28631{28632	int iCount = 0;28633	28634	int iLoop;28635	for (CvCity* pLoopCity = firstCity(&iLoop); pLoopCity != NULL; pLoopCity = nextCity(&iLoop)) {28636		iCount += pLoopCity->CountTerrain(iTerrainType);28637	}28638	28639	return iCount;28640}

Calls

Called by