Bazaar developer reference

CvTacticalAnalysisMap::IsInEnemyDominatedZone(CvPlot *)

Defined in
CvTacticalAnalysisMap.cpp, line 1204
Class
CvTacticalAnalysisMap
Hook name
CivHooks::CvTacticalAnalysisMap_IsInEnemyDominatedZone

Hooks

static bool BeforeCvTacticalAnalysisMap_IsInEnemyDominatedZone(CvTacticalAnalysisMap* self, CvPlot* pPlot, bool& result);static void AfterCvTacticalAnalysisMap_IsInEnemyDominatedZone(CvTacticalAnalysisMap* self, CvPlot* pPlot, bool& result);static bool ReplaceCvTacticalAnalysisMap_IsInEnemyDominatedZone(bool (*original)(CvTacticalAnalysisMap*, CvPlot*), CvTacticalAnalysisMap* self, CvPlot* pPlot);CivRegisterBefore<CivHooks::CvTacticalAnalysisMap_IsInEnemyDominatedZone>(host, &BeforeCvTacticalAnalysisMap_IsInEnemyDominatedZone);CivRegisterAfter<CivHooks::CvTacticalAnalysisMap_IsInEnemyDominatedZone>(host, &AfterCvTacticalAnalysisMap_IsInEnemyDominatedZone);CivRegisterReplace<CivHooks::CvTacticalAnalysisMap_IsInEnemyDominatedZone>(host, &ReplaceCvTacticalAnalysisMap_IsInEnemyDominatedZone);

Code

1203// Is this plot in dangerous territory?1204bool CvTacticalAnalysisMap::IsInEnemyDominatedZone(CvPlot* pPlot)1205{1206	CvTacticalAnalysisCell* pCell;1207	int iPlotIndex;1208	CvTacticalDominanceZone* pZone;12091210	iPlotIndex = GC.getMap().plotNum(pPlot->getX(), pPlot->getY());1211	pCell = GetCell(iPlotIndex);12121213	for(int iI = 0; iI < GetNumZones(); iI++)1214	{1215		pZone = GetZone(iI);1216		if(pZone->GetDominanceZoneID() == pCell->GetDominanceZone())1217		{1218			return (pZone->GetDominanceFlag() == TACTICAL_DOMINANCE_ENEMY);1219		}1220	}12211222	return false;1223}

Calls

Called by