// Find all our enemies (combat units) void CvTacticalAnalysisMap::BuildEnemyUnitList() { m_EnemyUnits.clear(); m_EnemyCities.clear(); TeamTypes ourTeam = GET_PLAYER(m_ePlayer).getTeam(); for(int iPlayer = 0; iPlayer < MAX_PLAYERS; iPlayer++) { const PlayerTypes ePlayer = (PlayerTypes)iPlayer; CvPlayer& kPlayer = GET_PLAYER(ePlayer); const TeamTypes eTeam = kPlayer.getTeam(); // for each opposing civ if(kPlayer.isAlive() && GET_TEAM(eTeam).isAtWar(ourTeam)) { int iLoop; CvUnit* pLoopUnit = NULL; CvCity* pLoopCity; for(pLoopCity = kPlayer.firstCity(&iLoop); pLoopCity != NULL; pLoopCity = kPlayer.nextCity(&iLoop)) if (pLoopCity->plot()->isRevealed(ourTeam)) m_EnemyCities.push_back(pLoopCity->GetIDInfo()); for(pLoopUnit = kPlayer.firstUnit(&iLoop); pLoopUnit != NULL; pLoopUnit = kPlayer.nextUnit(&iLoop)) if(pLoopUnit->IsCanAttack() && pLoopUnit->plot()->isVisible(ourTeam)) m_EnemyUnits.push_back(pLoopUnit->GetIDInfo()); } } }