Bazaar developer reference

CvPlayer::CountAllWorkedTerrain(TerrainTypes)

Defined in
CvPlayer.cpp, line 28642
Class
CvPlayer
Hook name
CivHooks::CvPlayer_CountAllWorkedTerrain

Hooks

static bool BeforeCvPlayer_CountAllWorkedTerrain(CvPlayer* self, TerrainTypes iTerrainType, int& result);static void AfterCvPlayer_CountAllWorkedTerrain(CvPlayer* self, TerrainTypes iTerrainType, int& result);static int ReplaceCvPlayer_CountAllWorkedTerrain(int (*original)(CvPlayer*, TerrainTypes), CvPlayer* self, TerrainTypes iTerrainType);CivRegisterBefore<CivHooks::CvPlayer_CountAllWorkedTerrain>(host, &BeforeCvPlayer_CountAllWorkedTerrain);CivRegisterAfter<CivHooks::CvPlayer_CountAllWorkedTerrain>(host, &AfterCvPlayer_CountAllWorkedTerrain);CivRegisterReplace<CivHooks::CvPlayer_CountAllWorkedTerrain>(host, &ReplaceCvPlayer_CountAllWorkedTerrain);

Code

28642int CvPlayer::CountAllWorkedTerrain(TerrainTypes iTerrainType)28643{28644	int iCount = 0;28645	28646	int iLoop;28647	for (CvCity* pLoopCity = firstCity(&iLoop); pLoopCity != NULL; pLoopCity = nextCity(&iLoop)) {28648		iCount += pLoopCity->CountWorkedTerrain(iTerrainType);28649	}28650	28651	return iCount;28652}

Calls

Called by