Bazaar developer reference

CvCity::IsHasBuildingThatAllowsRangeStrike() const

Defined in
CvCity.cpp, line 16081
Class
CvCity
Hook name
CivHooks::CvCity_IsHasBuildingThatAllowsRangeStrike

Hooks

static bool BeforeCvCity_IsHasBuildingThatAllowsRangeStrike(const CvCity* self, bool& result);static void AfterCvCity_IsHasBuildingThatAllowsRangeStrike(const CvCity* self, bool& result);static bool ReplaceCvCity_IsHasBuildingThatAllowsRangeStrike(bool (*original)(const CvCity*), const CvCity* self);CivRegisterBefore<CivHooks::CvCity_IsHasBuildingThatAllowsRangeStrike>(host, &BeforeCvCity_IsHasBuildingThatAllowsRangeStrike);CivRegisterAfter<CivHooks::CvCity_IsHasBuildingThatAllowsRangeStrike>(host, &AfterCvCity_IsHasBuildingThatAllowsRangeStrike);CivRegisterReplace<CivHooks::CvCity_IsHasBuildingThatAllowsRangeStrike>(host, &ReplaceCvCity_IsHasBuildingThatAllowsRangeStrike);

Code

16080/// Does this City have a Building that allows it to Range Strike?16081bool CvCity::IsHasBuildingThatAllowsRangeStrike() const16082{16083	VALIDATE_OBJECT16084	bool bHasBuildingThatAllowsRangeStrike = false;1608516086	for(int iBuildingLoop = 0; iBuildingLoop < GC.getNumBuildingInfos(); iBuildingLoop++)16087	{16088		const BuildingTypes eBuilding = static_cast<BuildingTypes>(iBuildingLoop);16089		CvBuildingEntry* pkBuildingInfo = GC.getBuildingInfo(eBuilding);1609016091		if(pkBuildingInfo)16092		{16093			// Has this Building16094			if(GetCityBuildings()->GetNumBuilding(eBuilding) > 0)16095			{16096				// Does it grant Range Strike ability?16097				if(pkBuildingInfo->IsAllowsRangeStrike())16098				{16099					bHasBuildingThatAllowsRangeStrike = true;16100					break;16101				}16102			}16103		}16104	}1610516106	return bHasBuildingThatAllowsRangeStrike;16107}

Calls