Bazaar developer reference

CvPlayer::HasBuilding(BuildingTypes)

Defined in
CvPlayer.cpp, line 28126
Class
CvPlayer
Hook name
CivHooks::CvPlayer_HasBuilding

Hooks

static bool BeforeCvPlayer_HasBuilding(CvPlayer* self, BuildingTypes iBuildingType, bool& result);static void AfterCvPlayer_HasBuilding(CvPlayer* self, BuildingTypes iBuildingType, bool& result);static bool ReplaceCvPlayer_HasBuilding(bool (*original)(CvPlayer*, BuildingTypes), CvPlayer* self, BuildingTypes iBuildingType);CivRegisterBefore<CivHooks::CvPlayer_HasBuilding>(host, &BeforeCvPlayer_HasBuilding);CivRegisterAfter<CivHooks::CvPlayer_HasBuilding>(host, &AfterCvPlayer_HasBuilding);CivRegisterReplace<CivHooks::CvPlayer_HasBuilding>(host, &ReplaceCvPlayer_HasBuilding);

Code

28126bool CvPlayer::HasBuilding(BuildingTypes iBuildingType)28127{28128	int iLoopCity;28129	for (CvCity* pLoopCity = firstCity(&iLoopCity); pLoopCity != NULL; pLoopCity = nextCity(&iLoopCity)) {28130		if (pLoopCity->HasBuilding(iBuildingType)) {28131			return true;28132		}28133	}2813428135	return false;28136}

Calls

Called by