Bazaar developer reference

CvPlot::getSelectedUnit() const

Defined in
CvPlot.cpp, line 3010
Class
CvPlot
Hook name
CivHooks::CvPlot_getSelectedUnit_with_void_const

Hooks

static bool BeforeCvPlot_getSelectedUnit_with_void_const(const CvPlot* self, const CvUnit*& result);static void AfterCvPlot_getSelectedUnit_with_void_const(const CvPlot* self, const CvUnit*& result);static const CvUnit* ReplaceCvPlot_getSelectedUnit_with_void_const(const CvUnit* (*original)(const CvPlot*), const CvPlot* self);CivRegisterBefore<CivHooks::CvPlot_getSelectedUnit_with_void_const>(host, &BeforeCvPlot_getSelectedUnit_with_void_const);CivRegisterAfter<CivHooks::CvPlot_getSelectedUnit_with_void_const>(host, &AfterCvPlot_getSelectedUnit_with_void_const);CivRegisterReplace<CivHooks::CvPlot_getSelectedUnit_with_void_const>(host, &ReplaceCvPlot_getSelectedUnit_with_void_const);

Code

3010const CvUnit* CvPlot::getSelectedUnit() const3011{3012	const IDInfo* pUnitNode;3013	const CvUnit* pLoopUnit;30143015	pUnitNode = headUnitNode();30163017	while(pUnitNode != NULL)3018	{3019		pLoopUnit = GetPlayerUnit(*pUnitNode);3020		pUnitNode = nextUnitNode(pUnitNode);30213022		if(pLoopUnit && pLoopUnit->IsSelected())3023		{3024			return pLoopUnit;3025		}3026	}30273028	return NULL;3029}

Calls

Called by