Bazaar developer reference

CvCity::canHurry(HurryTypes, bool) const

Defined in
CvCity.cpp, line 5951
Class
CvCity
Hook name
CivHooks::CvCity_canHurry

Hooks

static bool BeforeCvCity_canHurry(const CvCity* self, HurryTypes eHurry, bool bTestVisible, bool& result);static void AfterCvCity_canHurry(const CvCity* self, HurryTypes eHurry, bool bTestVisible, bool& result);static bool ReplaceCvCity_canHurry(bool (*original)(const CvCity*, HurryTypes, bool), const CvCity* self, HurryTypes eHurry, bool bTestVisible);CivRegisterBefore<CivHooks::CvCity_canHurry>(host, &BeforeCvCity_canHurry);CivRegisterAfter<CivHooks::CvCity_canHurry>(host, &AfterCvCity_canHurry);CivRegisterReplace<CivHooks::CvCity_canHurry>(host, &ReplaceCvCity_canHurry);

Code

5951bool CvCity::canHurry(HurryTypes eHurry, bool bTestVisible) const5952{5953	VALIDATE_OBJECT5954	if(!(GET_PLAYER(getOwner()).IsHasAccessToHurry(eHurry)))5955	{5956		return false;5957	}59585959	if(getProduction() >= getProductionNeeded())5960	{5961		return false;5962	}59635964	CvHurryInfo* pkHurryInfo = GC.getHurryInfo(eHurry);5965	if(pkHurryInfo == NULL)5966		return false;596759685969	// City cannot Hurry Player-level things5970	if(pkHurryInfo->getGoldPerBeaker() > 0 || pkHurryInfo->getGoldPerCulture() > 0)5971	{5972		return false;5973	}59745975	if(!bTestVisible)5976	{5977		if(!isProductionUnit() && !isProductionBuilding())5978		{5979			return false;5980		}59815982		if(GET_PLAYER(getOwner()).GetTreasury()->GetGold() < hurryGold(eHurry))5983		{5984			return false;5985		}59865987		if(maxHurryPopulation() < hurryPopulation(eHurry))5988		{5989			return false;5990		}5991	}59925993	return true;5994}

Calls

Called by