Bazaar developer reference

GetCity(const PlayerTypes, const CvPlot *)

Defined in
CvWorldBuilderMapLoader.cpp, line 780
Hook name
CivHooks::GetCity

Hooks

static bool BeforeGetCity(const PlayerTypes ePlayer, const CvPlot* pkPlot, const CvCity*& result);static void AfterGetCity(const PlayerTypes ePlayer, const CvPlot* pkPlot, const CvCity*& result);static const CvCity* ReplaceGetCity(const CvCity* (*original)(const PlayerTypes, const CvPlot*), const PlayerTypes ePlayer, const CvPlot* pkPlot);CivRegisterBefore<CivHooks::GetCity>(host, &BeforeGetCity);CivRegisterAfter<CivHooks::GetCity>(host, &AfterGetCity);CivRegisterReplace<CivHooks::GetCity>(host, &ReplaceGetCity);

Code

780const CvCity* GetCity(const PlayerTypes ePlayer, const CvPlot* pkPlot)781{782	if(pkPlot != NULL)783	{784		const CvCity* pkCity = pkPlot->getPlotCity();785		if(pkCity != NULL && pkCity->getOwner() == ePlayer)786			return pkCity;787	}788789	return NULL;790}

Calls

Called by