void CvTradeRoute::setDestinationCity(const IDInfo& kCity) { if (getDestinationCity() != kCity) { setActiveDirty(); const IDInfo& kOldCity = getDestinationCity(); m_kDestinationCity = kCity; CvCity* pCity = ::getCity(getDestinationCity()); FAssert(pCity != NULL || getDestinationCity().iID == EUROPE_CITY_ID); if (pCity != NULL) { pCity->updateImport(getYield()); } pCity = ::getCity(kOldCity); FAssert(pCity != NULL || getDestinationCity().iID == EUROPE_CITY_ID); if (pCity != NULL) { pCity->updateImport(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(); } }