Bazaar developer reference

CvDllGameContext::DestroyRandomNumberGenerator(unsigned int)

Defined in
CvDllContext.cpp, line 1155
Class
CvDllGameContext
Hook name
CivHooks::CvDllGameContext_DestroyRandomNumberGenerator

Hooks

static bool BeforeCvDllGameContext_DestroyRandomNumberGenerator(CvDllGameContext* self, unsigned int index);static void AfterCvDllGameContext_DestroyRandomNumberGenerator(CvDllGameContext* self, unsigned int index);static void ReplaceCvDllGameContext_DestroyRandomNumberGenerator(void (*original)(CvDllGameContext*, unsigned int), CvDllGameContext* self, unsigned int index);// CivHooks.h gives this hook point no types, so nothing checks these hooks' parameters.host->RegisterHook(host->pluginIndex, CivHooks::CvDllGameContext_DestroyRandomNumberGenerator::ID, CIV_HOOK_BEFORE, (void*)&BeforeCvDllGameContext_DestroyRandomNumberGenerator);host->RegisterHook(host->pluginIndex, CivHooks::CvDllGameContext_DestroyRandomNumberGenerator::ID, CIV_HOOK_AFTER, (void*)&AfterCvDllGameContext_DestroyRandomNumberGenerator);host->RegisterHook(host->pluginIndex, CivHooks::CvDllGameContext_DestroyRandomNumberGenerator::ID, CIV_HOOK_REPLACE, (void*)&ReplaceCvDllGameContext_DestroyRandomNumberGenerator);

Code

1155void CvDllGameContext::DestroyRandomNumberGenerator(unsigned int index)1156{1157	std::vector<std::pair<uint, CvRandom*> >::iterator it = m_RandomNumberGenerators.end();1158	for(it = m_RandomNumberGenerators.begin();1159	        it != m_RandomNumberGenerators.end(); ++it)1160	{1161		if((*it).first == index)1162			break;1163	}11641165	if(it != m_RandomNumberGenerators.end())1166	{1167		delete(*it).second;1168		m_RandomNumberGenerators.erase(it);1169	}1170}

Calls