Bazaar developer reference

CityStrategyAIHelpers::IsTestCityStrategy_MediumCity(CvCity *)

Defined in
CvCityStrategyAI.cpp, line 2230
Hook name
CivHooks::CityStrategyAIHelpers_IsTestCityStrategy_MediumCity

Hooks

static bool BeforeCityStrategyAIHelpers_IsTestCityStrategy_MediumCity(CvCity* pCity, bool& result);static void AfterCityStrategyAIHelpers_IsTestCityStrategy_MediumCity(CvCity* pCity, bool& result);static bool ReplaceCityStrategyAIHelpers_IsTestCityStrategy_MediumCity(bool (*original)(CvCity*), CvCity* pCity);CivRegisterBefore<CivHooks::CityStrategyAIHelpers_IsTestCityStrategy_MediumCity>(host, &BeforeCityStrategyAIHelpers_IsTestCityStrategy_MediumCity);CivRegisterAfter<CivHooks::CityStrategyAIHelpers_IsTestCityStrategy_MediumCity>(host, &AfterCityStrategyAIHelpers_IsTestCityStrategy_MediumCity);CivRegisterReplace<CivHooks::CityStrategyAIHelpers_IsTestCityStrategy_MediumCity>(host, &ReplaceCityStrategyAIHelpers_IsTestCityStrategy_MediumCity);

Code

2229/// "Medium City" City Strategy: If a City is 8 or above Population boost science2230bool CityStrategyAIHelpers::IsTestCityStrategy_MediumCity(CvCity* pCity)2231{2232	// Never consider the capital to be a medium city (so with late game starts at least one city retains high flavors for SPACESHIP, etc.)2233	if (pCity->isCapital())2234	{2235		return false;2236	}22372238	// City Population is getting larger, increase science2239	if(pCity->getPopulation() >= GC.getAI_CITYSTRATEGY_MEDIUM_CITY_POP_THRESHOLD() &&   // 5 to 112240	        pCity->getPopulation() < GC.getAI_CITYSTRATEGY_LARGE_CITY_POP_THRESHOLD())2241	{2242		return true;2243	}22442245	return false;2246}

Calls

Called by