Bazaar developer reference

CvCitySiteEvaluator::PlotFertilityValue(CvPlot *)

Defined in
CvSiteEvaluationClasses.cpp, line 743
Class
CvCitySiteEvaluator
Hook name
CivHooks::CvCitySiteEvaluator_PlotFertilityValue

Hooks

static bool BeforeCvCitySiteEvaluator_PlotFertilityValue(CvCitySiteEvaluator* self, CvPlot* pPlot, int& result);static void AfterCvCitySiteEvaluator_PlotFertilityValue(CvCitySiteEvaluator* self, CvPlot* pPlot, int& result);static int ReplaceCvCitySiteEvaluator_PlotFertilityValue(int (*original)(CvCitySiteEvaluator*, CvPlot*), CvCitySiteEvaluator* self, CvPlot* pPlot);CivRegisterBefore<CivHooks::CvCitySiteEvaluator_PlotFertilityValue>(host, &BeforeCvCitySiteEvaluator_PlotFertilityValue);CivRegisterAfter<CivHooks::CvCitySiteEvaluator_PlotFertilityValue>(host, &AfterCvCitySiteEvaluator_PlotFertilityValue);CivRegisterReplace<CivHooks::CvCitySiteEvaluator_PlotFertilityValue>(host, &ReplaceCvCitySiteEvaluator_PlotFertilityValue);

Code

742/// Retrieve the relative fertility of this plot (alone)743int CvCitySiteEvaluator::PlotFertilityValue(CvPlot* pPlot)744{745	int rtnValue = 0;746747	if(!pPlot->isWater() && !pPlot->isImpassable() && !pPlot->isMountain())748	{749		rtnValue += ComputeFoodValue(pPlot, NULL);750		rtnValue += ComputeProductionValue(pPlot, NULL);751		rtnValue += ComputeGoldValue(pPlot, NULL);752		rtnValue += ComputeScienceValue(pPlot, NULL);753		rtnValue += ComputeTradeableResourceValue(pPlot, NULL);754	}755756	if(rtnValue < 0) rtnValue = 0;757758	return rtnValue;759}

Calls

Called by