Bazaar developer reference

CityStrategyAIHelpers::IsTestCityStrategy_MountainCity(CvCity *)

Defined in
CvCityStrategyAI.cpp, line 3042
Hook name
CivHooks::CityStrategyAIHelpers_IsTestCityStrategy_MountainCity

Hooks

static bool BeforeCityStrategyAIHelpers_IsTestCityStrategy_MountainCity(CvCity* pCity, bool& result);static void AfterCityStrategyAIHelpers_IsTestCityStrategy_MountainCity(CvCity* pCity, bool& result);static bool ReplaceCityStrategyAIHelpers_IsTestCityStrategy_MountainCity(bool (*original)(CvCity*), CvCity* pCity);CivRegisterBefore<CivHooks::CityStrategyAIHelpers_IsTestCityStrategy_MountainCity>(host, &BeforeCityStrategyAIHelpers_IsTestCityStrategy_MountainCity);CivRegisterAfter<CivHooks::CityStrategyAIHelpers_IsTestCityStrategy_MountainCity>(host, &AfterCityStrategyAIHelpers_IsTestCityStrategy_MountainCity);CivRegisterReplace<CivHooks::CityStrategyAIHelpers_IsTestCityStrategy_MountainCity>(host, &ReplaceCityStrategyAIHelpers_IsTestCityStrategy_MountainCity);

Code

3041/// "Mountain City" City Strategy: give a little flavor to this city3042bool CityStrategyAIHelpers::IsTestCityStrategy_MountainCity(CvCity* pCity)3043{3044	// scan the nearby tiles to see if there is a mountain close enough to build an observatory3045	CvPlot* pPlot = pCity->plot();3046	for(int iDirectionLoop = 0; iDirectionLoop < NUM_DIRECTION_TYPES; iDirectionLoop++)3047	{3048		CvPlot* pAdjacentPlot = plotDirection(pPlot->getX(), pPlot->getY(), ((DirectionTypes)iDirectionLoop));3049		if(pAdjacentPlot != NULL)3050		{3051			if(pAdjacentPlot->isMountain())3052			{3053				return true;3054			}3055		}3056	}305730583059	return false;3060}

Calls

Called by