Bazaar developer reference

CvGameTrade::IsDestinationExclusive(const TradeConnection &)

Defined in
CvTradeClasses.cpp, line 558
Class
CvGameTrade
Hook name
CivHooks::CvGameTrade_IsDestinationExclusive

Hooks

static bool BeforeCvGameTrade_IsDestinationExclusive(CvGameTrade* self, const TradeConnection& kTradeConnection, bool& result);static void AfterCvGameTrade_IsDestinationExclusive(CvGameTrade* self, const TradeConnection& kTradeConnection, bool& result);static bool ReplaceCvGameTrade_IsDestinationExclusive(bool (*original)(CvGameTrade*, const TradeConnection&), CvGameTrade* self, const TradeConnection& kTradeConnection);CivRegisterBefore<CivHooks::CvGameTrade_IsDestinationExclusive>(host, &BeforeCvGameTrade_IsDestinationExclusive);CivRegisterAfter<CivHooks::CvGameTrade_IsDestinationExclusive>(host, &AfterCvGameTrade_IsDestinationExclusive);CivRegisterReplace<CivHooks::CvGameTrade_IsDestinationExclusive>(host, &ReplaceCvGameTrade_IsDestinationExclusive);

Code

558bool CvGameTrade::IsDestinationExclusive(const TradeConnection& kTradeConnection)559{560	TradeConnection* pConnection = NULL;561	for (uint ui = 0; ui < m_aTradeConnections.size(); ui++)562	{563		pConnection = &(m_aTradeConnections[ui]);564		if (pConnection->m_iDestX == kTradeConnection.m_iDestX && pConnection->m_iDestY == kTradeConnection.m_iDestY)565		{566			// if we're double counting the same route, ignore567			if (pConnection->m_iOriginX == kTradeConnection.m_iOriginX && pConnection->m_iOriginY == kTradeConnection.m_iOriginY)568			{569				continue;570			}571			else572			{573				return false;574			}575		}576	}577578	return true;579}

Calls

Called by