Bazaar developer reference

CvGame::AnyoneHasBuilding(BuildingTypes) const

Defined in
CvGame.cpp, line 12014
Class
CvGame
Hook name
CivHooks::CvGame_AnyoneHasBuilding

Hooks

static bool BeforeCvGame_AnyoneHasBuilding(const CvGame* self, BuildingTypes iBuildingType, bool& result);static void AfterCvGame_AnyoneHasBuilding(const CvGame* self, BuildingTypes iBuildingType, bool& result);static bool ReplaceCvGame_AnyoneHasBuilding(bool (*original)(const CvGame*, BuildingTypes), const CvGame* self, BuildingTypes iBuildingType);CivRegisterBefore<CivHooks::CvGame_AnyoneHasBuilding>(host, &BeforeCvGame_AnyoneHasBuilding);CivRegisterAfter<CivHooks::CvGame_AnyoneHasBuilding>(host, &AfterCvGame_AnyoneHasBuilding);CivRegisterReplace<CivHooks::CvGame_AnyoneHasBuilding>(host, &ReplaceCvGame_AnyoneHasBuilding);

Code

12014bool CvGame::AnyoneHasBuilding(BuildingTypes iBuildingType) const12015{12016	for (int i = 0; i < MAX_PLAYERS; ++i) {12017		CvPlayer& player = GET_PLAYER(static_cast<PlayerTypes>(i));1201812019		if(player.isAlive() && player.HasBuilding(iBuildingType)) {12020			return true;12021		}12022	}1202312024	return false;12025}

Calls

Called by