Bazaar developer reference

CvGame::changePlotExtraCost(int, int, int)

Defined in
CvGame.cpp, line 10127
Class
CvGame
Hook name
CivHooks::CvGame_changePlotExtraCost

Hooks

static bool BeforeCvGame_changePlotExtraCost(CvGame* self, int iX, int iY, int iCost);static void AfterCvGame_changePlotExtraCost(CvGame* self, int iX, int iY, int iCost);static void ReplaceCvGame_changePlotExtraCost(void (*original)(CvGame*, int, int, int), CvGame* self, int iX, int iY, int iCost);CivRegisterBefore<CivHooks::CvGame_changePlotExtraCost>(host, &BeforeCvGame_changePlotExtraCost);CivRegisterAfter<CivHooks::CvGame_changePlotExtraCost>(host, &AfterCvGame_changePlotExtraCost);CivRegisterReplace<CivHooks::CvGame_changePlotExtraCost>(host, &ReplaceCvGame_changePlotExtraCost);

Code

10127void CvGame::changePlotExtraCost(int iX, int iY, int iCost)10128{10129	bool bFound = false;1013010131	for(std::vector<PlotExtraCost>::iterator it = m_aPlotExtraCosts.begin(); it != m_aPlotExtraCosts.end(); ++it)10132	{10133		if((*it).m_iX == iX && (*it).m_iY == iY)10134		{10135			(*it).m_iCost += iCost;10136			bFound = true;10137			break;10138		}10139	}1014010141	if(!bFound)10142	{10143		PlotExtraCost kExtraCost;10144		kExtraCost.m_iX = iX;10145		kExtraCost.m_iY = iY;10146		kExtraCost.m_iCost = iCost;10147		m_aPlotExtraCosts.push_back(kExtraCost);10148	}10149}

Calls

Called by