Bazaar developer reference

CvDllPlot::IsEnemyCity(ICvUnit1 *) const

Defined in
CvDllPlot.cpp, line 130
Class
CvDllPlot
Hook name
CivHooks::CvDllPlot_IsEnemyCity

Hooks

static bool BeforeCvDllPlot_IsEnemyCity(const CvDllPlot* self, ICvUnit1* pUnit, bool& result);static void AfterCvDllPlot_IsEnemyCity(const CvDllPlot* self, ICvUnit1* pUnit, bool& result);static bool ReplaceCvDllPlot_IsEnemyCity(bool (*original)(const CvDllPlot*, ICvUnit1*), const CvDllPlot* self, ICvUnit1* pUnit);// CivHooks.h gives this hook point no types, so nothing checks these hooks' parameters.host->RegisterHook(host->pluginIndex, CivHooks::CvDllPlot_IsEnemyCity::ID, CIV_HOOK_BEFORE, (void*)&BeforeCvDllPlot_IsEnemyCity);host->RegisterHook(host->pluginIndex, CivHooks::CvDllPlot_IsEnemyCity::ID, CIV_HOOK_AFTER, (void*)&AfterCvDllPlot_IsEnemyCity);host->RegisterHook(host->pluginIndex, CivHooks::CvDllPlot_IsEnemyCity::ID, CIV_HOOK_REPLACE, (void*)&ReplaceCvDllPlot_IsEnemyCity);

Code

130bool CvDllPlot::IsEnemyCity(ICvUnit1* pUnit) const131{132	CvUnit* pkUnit = (NULL != pUnit)? static_cast<CvDllUnit*>(pUnit)->GetInstance() : NULL;133	if(pkUnit != NULL)134		return m_pPlot->isEnemyCity(*pkUnit);135	else136		return false;137}

Calls