Bazaar developer reference

CvPlot::IsAdjacentToTerrain(TerrainTypes) const

Defined in
CvPlot.cpp, line 12064
Class
CvPlot
Hook name
CivHooks::CvPlot_IsAdjacentToTerrain

Hooks

static bool BeforeCvPlot_IsAdjacentToTerrain(const CvPlot* self, TerrainTypes iTerrainType, bool& result);static void AfterCvPlot_IsAdjacentToTerrain(const CvPlot* self, TerrainTypes iTerrainType, bool& result);static bool ReplaceCvPlot_IsAdjacentToTerrain(bool (*original)(const CvPlot*, TerrainTypes), const CvPlot* self, TerrainTypes iTerrainType);CivRegisterBefore<CivHooks::CvPlot_IsAdjacentToTerrain>(host, &BeforeCvPlot_IsAdjacentToTerrain);CivRegisterAfter<CivHooks::CvPlot_IsAdjacentToTerrain>(host, &AfterCvPlot_IsAdjacentToTerrain);CivRegisterReplace<CivHooks::CvPlot_IsAdjacentToTerrain>(host, &ReplaceCvPlot_IsAdjacentToTerrain);

Code

12064bool CvPlot::IsAdjacentToTerrain(TerrainTypes iTerrainType) const12065{12066	int iX = getX(); int iY = getY();1206712068	for (int iDirection = 0; iDirection < NUM_DIRECTION_TYPES; iDirection++) {12069		CvPlot* pLoopPlot = plotDirection(iX, iY, (DirectionTypes) iDirection);1207012071		if (pLoopPlot != NULL && pLoopPlot->HasTerrain(iTerrainType)) {12072			return true;12073		}12074	}1207512076	return false;12077}

Calls

Called by