CvGameTrade::GetNumTradeRoutesInPlot(CvPlot *)
- Defined in
- CvTradeClasses.cpp, line 1201
- Class
- CvGameTrade
- Hook name
CivHooks::CvGameTrade_GetNumTradeRoutesInPlot
Hooks
static bool BeforeCvGameTrade_GetNumTradeRoutesInPlot(CvGameTrade* self, CvPlot* pPlot, int& result);static void AfterCvGameTrade_GetNumTradeRoutesInPlot(CvGameTrade* self, CvPlot* pPlot, int& result);static int ReplaceCvGameTrade_GetNumTradeRoutesInPlot(int (*original)(CvGameTrade*, CvPlot*), CvGameTrade* self, CvPlot* pPlot);CivRegisterBefore<CivHooks::CvGameTrade_GetNumTradeRoutesInPlot>(host, &BeforeCvGameTrade_GetNumTradeRoutesInPlot);CivRegisterAfter<CivHooks::CvGameTrade_GetNumTradeRoutesInPlot>(host, &AfterCvGameTrade_GetNumTradeRoutesInPlot);CivRegisterReplace<CivHooks::CvGameTrade_GetNumTradeRoutesInPlot>(host, &ReplaceCvGameTrade_GetNumTradeRoutesInPlot);
Code
1201int CvGameTrade::GetNumTradeRoutesInPlot (CvPlot* pPlot)1202{1203 int iResult = 0;1204 int iX = pPlot->getX();1205 int iY = pPlot->getY();1206 for (uint ui = 0; ui < m_aTradeConnections.size(); ui++)1207 {1208 if (IsTradeRouteIndexEmpty(ui))1209 {1210 continue;1211 }12121213 for (uint uiPlot = 0; uiPlot < m_aTradeConnections[ui].m_aPlotList.size(); uiPlot++)1214 {1215 if (m_aTradeConnections[ui].m_aPlotList[uiPlot].m_iX == iX && m_aTradeConnections[ui].m_aPlotList[uiPlot].m_iY == iY)1216 {1217 iResult++;1218 }1219 }1220 }12211222 return iResult;1223}
Calls
BaseVector::operator[]BaseVector::operator[]BaseVector::sizeBaseVector::size- CvGameTrade::IsTradeRouteIndexEmpty(int)
- CvPlot::getX() const
- CvPlot::getY() const