Bazaar developer reference

CvGameDeals::DoUpdateCurrentDealsList()

Defined in
CvDealClasses.cpp, line 3033
Class
CvGameDeals
Hook name
CivHooks::CvGameDeals_DoUpdateCurrentDealsList

Hooks

static bool BeforeCvGameDeals_DoUpdateCurrentDealsList(CvGameDeals* self);static void AfterCvGameDeals_DoUpdateCurrentDealsList(CvGameDeals* self);static void ReplaceCvGameDeals_DoUpdateCurrentDealsList(void (*original)(CvGameDeals*), CvGameDeals* self);CivRegisterBefore<CivHooks::CvGameDeals_DoUpdateCurrentDealsList>(host, &BeforeCvGameDeals_DoUpdateCurrentDealsList);CivRegisterAfter<CivHooks::CvGameDeals_DoUpdateCurrentDealsList>(host, &AfterCvGameDeals_DoUpdateCurrentDealsList);CivRegisterReplace<CivHooks::CvGameDeals_DoUpdateCurrentDealsList>(host, &ReplaceCvGameDeals_DoUpdateCurrentDealsList);

Code

3032/// If a deal has actually ended, move it from the current list to the historic list3033void CvGameDeals::DoUpdateCurrentDealsList()3034{3035	DealList::iterator it;30363037	DealList tempDeals;30383039	// Copy the deals into a temporary container3040	for(it = m_CurrentDeals.begin(); it != m_CurrentDeals.end(); ++it)3041	{3042		tempDeals.push_back(*it);3043	}30443045	// Copy them to either current or historical deals based on whether or not they3046	// are still active3047	m_CurrentDeals.clear();3048	for(it = tempDeals.begin(); it != tempDeals.end(); ++it)3049	{3050		if(it->m_iFinalTurn <= GC.getGame().getGameTurn())3051		{3052			m_HistoricalDeals.push_back(*it);3053		}3054		else3055		{3056			m_CurrentDeals.push_back(*it);3057		}3058	}3059}

Calls

Called by