Code
6050/// Don't allow tiles within 2 to both be blockade points6051void CvTacticalAI::EliminateNearbyBlockadePoints()6052{6053 // First, sort the sentry points by priority6054 std::stable_sort(m_NavalResourceBlockadePoints.begin(), m_NavalResourceBlockadePoints.end());60556056 // Create temporary copy of list6057 TacticalList tempPoints;6058 tempPoints = m_NavalResourceBlockadePoints;60596060 // Clear out main list6061 m_NavalResourceBlockadePoints.clear();60626063 // Loop through all points in copy6064 TacticalList::iterator it, it2;6065 for(it = tempPoints.begin(); it != tempPoints.end(); ++it)6066 {6067 bool bFoundAdjacent = false;60686069 // Is it adjacent to a point in the main list?6070 for(it2 = m_NavalResourceBlockadePoints.begin(); it2 != m_NavalResourceBlockadePoints.end(); ++it2)6071 {6072 if(plotDistance(it->GetTargetX(), it->GetTargetY(), it2->GetTargetX(), it2->GetTargetY()) <= 2)6073 {6074 bFoundAdjacent = true;6075 break;6076 }6077 }60786079 if(!bFoundAdjacent)6080 {6081 m_NavalResourceBlockadePoints.push_back(*it);6082 }6083 }60846085 // Now copy all points into main target list6086 for(it = m_NavalResourceBlockadePoints.begin(); it != m_NavalResourceBlockadePoints.end(); ++it)6087 {6088 m_AllTargets.push_back(*it);6089 }6090}