Bazaar developer reference

CvDllUnit::CanSwapWithUnitHere(ICvPlot1 *) const

Defined in
CvDllUnit.cpp, line 207
Class
CvDllUnit
Hook name
CivHooks::CvDllUnit_CanSwapWithUnitHere

Hooks

static bool BeforeCvDllUnit_CanSwapWithUnitHere(const CvDllUnit* self, ICvPlot1* pPlot, bool& result);static void AfterCvDllUnit_CanSwapWithUnitHere(const CvDllUnit* self, ICvPlot1* pPlot, bool& result);static bool ReplaceCvDllUnit_CanSwapWithUnitHere(bool (*original)(const CvDllUnit*, ICvPlot1*), const CvDllUnit* self, ICvPlot1* pPlot);// CivHooks.h gives this hook point no types, so nothing checks these hooks' parameters.host->RegisterHook(host->pluginIndex, CivHooks::CvDllUnit_CanSwapWithUnitHere::ID, CIV_HOOK_BEFORE, (void*)&BeforeCvDllUnit_CanSwapWithUnitHere);host->RegisterHook(host->pluginIndex, CivHooks::CvDllUnit_CanSwapWithUnitHere::ID, CIV_HOOK_AFTER, (void*)&AfterCvDllUnit_CanSwapWithUnitHere);host->RegisterHook(host->pluginIndex, CivHooks::CvDllUnit_CanSwapWithUnitHere::ID, CIV_HOOK_REPLACE, (void*)&ReplaceCvDllUnit_CanSwapWithUnitHere);

Code

207bool CvDllUnit::CanSwapWithUnitHere(ICvPlot1* pPlot) const208{209	CvPlot* pkPlot = (NULL != pPlot)? static_cast<CvDllPlot*>(pPlot)->GetInstance() : NULL;210	FAssert(pkPlot != NULL);211	if(pkPlot != NULL)212		return m_pUnit->CanSwapWithUnitHere(*pkPlot);213	else214		return false;215}

Calls