CvPlot::GetNumAdjacentDifferentTeam(TeamTypes, bool) const
- Defined in
- CvPlot.cpp, line 3328
- Class
- CvPlot
- Hook name
CivHooks::CvPlot_GetNumAdjacentDifferentTeam
Hooks
static bool BeforeCvPlot_GetNumAdjacentDifferentTeam(const CvPlot* self, TeamTypes eTeam, bool bIgnoreWater, int& result);static void AfterCvPlot_GetNumAdjacentDifferentTeam(const CvPlot* self, TeamTypes eTeam, bool bIgnoreWater, int& result);static int ReplaceCvPlot_GetNumAdjacentDifferentTeam(int (*original)(const CvPlot*, TeamTypes, bool), const CvPlot* self, TeamTypes eTeam, bool bIgnoreWater);CivRegisterBefore<CivHooks::CvPlot_GetNumAdjacentDifferentTeam>(host, &BeforeCvPlot_GetNumAdjacentDifferentTeam);CivRegisterAfter<CivHooks::CvPlot_GetNumAdjacentDifferentTeam>(host, &AfterCvPlot_GetNumAdjacentDifferentTeam);CivRegisterReplace<CivHooks::CvPlot_GetNumAdjacentDifferentTeam>(host, &ReplaceCvPlot_GetNumAdjacentDifferentTeam);
Code
3327/// Number of adjacent tiles owned by another team (or unowned)3328int CvPlot::GetNumAdjacentDifferentTeam(TeamTypes eTeam, bool bIgnoreWater) const3329{3330 CvPlot* pAdjacentPlot;3331 int iI;3332 int iRtnValue = 0;33333334 for(iI = 0; iI < NUM_DIRECTION_TYPES; ++iI)3335 {3336 pAdjacentPlot = plotDirection(getX(), getY(), ((DirectionTypes)iI));33373338 if(pAdjacentPlot != NULL)3339 {3340 if(bIgnoreWater && pAdjacentPlot->isWater())3341 {3342 continue;3343 }33443345 if(pAdjacentPlot->getTeam() != eTeam)3346 {3347 iRtnValue++;3348 }3349 }3350 }33513352 return iRtnValue;3353}