CvArea::countCoastalLand() const
- Defined in
- CvArea.cpp, line 173
- Class
- CvArea
- Hook name
CivHooks::CvArea_countCoastalLand
Hooks
static bool BeforeCvArea_countCoastalLand(const CvArea* self, int& result);static void AfterCvArea_countCoastalLand(const CvArea* self, int& result);static int ReplaceCvArea_countCoastalLand(int (*original)(const CvArea*), const CvArea* self);CivRegisterBefore<CivHooks::CvArea_countCoastalLand>(host, &BeforeCvArea_countCoastalLand);CivRegisterAfter<CivHooks::CvArea_countCoastalLand>(host, &AfterCvArea_countCoastalLand);CivRegisterReplace<CivHooks::CvArea_countCoastalLand>(host, &ReplaceCvArea_countCoastalLand);
Code
173int CvArea::countCoastalLand() const174{175 CvPlot* pLoopPlot;176 int iCount;177 int iI;178179 if(isWater())180 {181 return 0;182 }183184 iCount = 0;185186 CvMap& theMap = GC.getMap();187 int iNumPlots = theMap.numPlots();188 for(iI = 0; iI < iNumPlots; iI++)189 {190 pLoopPlot = theMap.plotByIndexUnchecked(iI);191192 if(pLoopPlot->getArea() == GetID())193 {194 if(pLoopPlot->isCoastalLand())195 {196 iCount++;197 }198 }199 }200201 return iCount;202}