Bazaar developer reference

CvDllGame::GetPlotUnit(ICvPlot1 *, int)

Defined in
CvDllGame.cpp, line 239
Class
CvDllGame
Hook name
CivHooks::CvDllGame_GetPlotUnit

Hooks

static bool BeforeCvDllGame_GetPlotUnit(CvDllGame* self, ICvPlot1* pPlot, int iIndex, ICvUnit1*& result);static void AfterCvDllGame_GetPlotUnit(CvDllGame* self, ICvPlot1* pPlot, int iIndex, ICvUnit1*& result);static ICvUnit1* ReplaceCvDllGame_GetPlotUnit(ICvUnit1* (*original)(CvDllGame*, ICvPlot1*, int), CvDllGame* self, ICvPlot1* pPlot, int iIndex);// CivHooks.h gives this hook point no types, so nothing checks these hooks' parameters.host->RegisterHook(host->pluginIndex, CivHooks::CvDllGame_GetPlotUnit::ID, CIV_HOOK_BEFORE, (void*)&BeforeCvDllGame_GetPlotUnit);host->RegisterHook(host->pluginIndex, CivHooks::CvDllGame_GetPlotUnit::ID, CIV_HOOK_AFTER, (void*)&AfterCvDllGame_GetPlotUnit);host->RegisterHook(host->pluginIndex, CivHooks::CvDllGame_GetPlotUnit::ID, CIV_HOOK_REPLACE, (void*)&ReplaceCvDllGame_GetPlotUnit);

Code

239ICvUnit1* CvDllGame::GetPlotUnit(ICvPlot1* pPlot, int iIndex)240{241	CvPlot* pkPlot = (NULL != pPlot)? static_cast<CvDllPlot*>(pPlot)->GetInstance() : NULL;242	CvUnit* pkUnit = m_pGame->getPlotUnit(pkPlot, iIndex);243244	return (NULL != pkUnit)? new CvDllUnit(pkUnit) : NULL;245}

Calls