CvHomelandAI::PlotAncientRuinMoves()
- Defined in
- CvHomelandAI.cpp, line 1736
- Class
- CvHomelandAI
- Hook name
CivHooks::CvHomelandAI_PlotAncientRuinMoves
Hooks
static bool BeforeCvHomelandAI_PlotAncientRuinMoves(CvHomelandAI* self);static void AfterCvHomelandAI_PlotAncientRuinMoves(CvHomelandAI* self);static void ReplaceCvHomelandAI_PlotAncientRuinMoves(void (*original)(CvHomelandAI*), CvHomelandAI* self);CivRegisterBefore<CivHooks::CvHomelandAI_PlotAncientRuinMoves>(host, &BeforeCvHomelandAI_PlotAncientRuinMoves);CivRegisterAfter<CivHooks::CvHomelandAI_PlotAncientRuinMoves>(host, &AfterCvHomelandAI_PlotAncientRuinMoves);CivRegisterReplace<CivHooks::CvHomelandAI_PlotAncientRuinMoves>(host, &ReplaceCvHomelandAI_PlotAncientRuinMoves);
Code
1735/// Pop goody huts nearby1736void CvHomelandAI::PlotAncientRuinMoves()1737{1738 // Do we have any targets of this type?1739 if(!m_TargetedAncientRuins.empty())1740 {1741 // Prioritize them (LATER)17421743 // See how many moves of this type we can execute1744 for(unsigned int iI = 0; iI < m_TargetedAncientRuins.size(); iI++)1745 {1746 CvPlot* pTarget = GC.getMap().plot(m_TargetedAncientRuins[iI].GetTargetX(), m_TargetedAncientRuins[iI].GetTargetY());17471748 FindUnitsForThisMove(AI_HOMELAND_MOVE_ANCIENT_RUINS, (iI == 0)/*bFirstTime*/);17491750 if(m_CurrentMoveHighPriorityUnits.size() + m_CurrentMoveUnits.size() > 0)1751 {1752 if(GetBestUnitToReachTarget(pTarget, m_iDefensiveMoveTurns))1753 {1754 ExecuteMoveToTarget(pTarget);17551756 if(GC.getLogging() && GC.getAILogging())1757 {1758 CvString strLogString;1759 strLogString.Format("Moving to goody hut (non-explorer), X: %d, Y: %d", m_TargetedAncientRuins[iI].GetTargetX(), m_TargetedAncientRuins[iI].GetTargetY());1760 LogHomelandMessage(strLogString);1761 }1762 }1763 }1764 }1765 }1766}
Calls
BaseVector::size- CvGlobals::getAILogging()
- CvGlobals::getLogging()
- CvGlobals::getMap()
- CvHomelandAI::ExecuteMoveToTarget(CvPlot *)
- CvHomelandAI::FindUnitsForThisMove(AIHomelandMove, bool)
- CvHomelandAI::GetBestUnitToReachTarget(CvPlot *, int)
- CvHomelandAI::LogHomelandMessage(CvString &)
- CvHomelandTarget::GetTargetX()
- CvHomelandTarget::GetTargetY()
- CvMap::plot(int, int) const
CvString::CvStringCvString::Formatstd::vector::emptystd::vector::operator[]std::vector::size