void CvTradeRoute::setSourceCity(const IDInfo& kCity) { if (getSourceCity() != kCity) { setActiveDirty(); const IDInfo& kOldCity = getSourceCity(); m_kSourceCity = kCity; CvCity* pCity = ::getCity(getSourceCity()); FAssert(pCity != NULL); if (pCity != NULL) { pCity->updateExport(getYield()); } pCity = ::getCity(kOldCity); FAssert(pCity != NULL); if (pCity != NULL) { pCity->updateExport(getYield()); } setActiveDirty(); } }
void CvTradeRoute::setYield(YieldTypes eYield) { if (getYield() != eYield) { YieldTypes eOldYield = getYield(); m_eYield = eYield; CvCity* pCity = ::getCity(getDestinationCity()); FAssert(pCity != NULL); if (pCity != NULL) { pCity->updateImport(getYield()); pCity->updateImport(eOldYield); } pCity = ::getCity(getSourceCity()); FAssert(pCity != NULL); if (pCity != NULL) { pCity->updateExport(getYield()); pCity->updateExport(eOldYield); } setActiveDirty(); } }