CvTacticalAI::SamePlotFound(vector<CvPlot *>, CvPlot *)
- Defined in
- CvTacticalAI.cpp, line 8860
- Class
- CvTacticalAI
- Hook name
CivHooks::CvTacticalAI_SamePlotFound
Hooks
static bool BeforeCvTacticalAI_SamePlotFound(CvTacticalAI* self, vector<CvPlot*> plotData, CvPlot* plotXy, int& result);static void AfterCvTacticalAI_SamePlotFound(CvTacticalAI* self, vector<CvPlot*> plotData, CvPlot* plotXy, int& result);static int ReplaceCvTacticalAI_SamePlotFound(int (*original)(CvTacticalAI*, vector<CvPlot*>, CvPlot*), CvTacticalAI* self, vector<CvPlot*> plotData, CvPlot* plotXy);CivRegisterBefore<CivHooks::CvTacticalAI_SamePlotFound>(host, &BeforeCvTacticalAI_SamePlotFound);CivRegisterAfter<CivHooks::CvTacticalAI_SamePlotFound>(host, &AfterCvTacticalAI_SamePlotFound);CivRegisterReplace<CivHooks::CvTacticalAI_SamePlotFound>(host, &ReplaceCvTacticalAI_SamePlotFound);
Code
8858#if defined(MOD_AI_SMART_V3)8859//AMS: helper function to iterate vector that is of CvPlot Type.8860int CvTacticalAI::SamePlotFound(vector<CvPlot*> plotData, CvPlot* plotXy)8861{8862 int methodResult = 0;8863 std::vector<CvPlot*>::iterator it;88648865 for (it = plotData.begin(); it != plotData.end(); it++)8866 {8867 if (((*it)->getX() == plotXy->getX()) && ((*it)->getY() == plotXy->getY()))8868 {8869 methodResult++;8870 }8871 }88728873 return methodResult;8874}
Calls
- CvPlot::getX() const
- CvPlot::getY() const
std::_Vector_const_iterator::operator!=std::_Vector_iterator::_Vector_iteratorstd::_Vector_iterator::operator*std::_Vector_iterator::operator++std::_Vector_iterator::operator=std::vector::beginstd::vector::end