Bazaar developer reference

CvProjectProductionAI::Reset()

Defined in
CvProjectProductionAI.cpp, line 26
Class
CvProjectProductionAI
Hook name
CivHooks::CvProjectProductionAI_Reset

Hooks

static bool BeforeCvProjectProductionAI_Reset(CvProjectProductionAI* self);static void AfterCvProjectProductionAI_Reset(CvProjectProductionAI* self);static void ReplaceCvProjectProductionAI_Reset(void (*original)(CvProjectProductionAI*), CvProjectProductionAI* self);CivRegisterBefore<CivHooks::CvProjectProductionAI_Reset>(host, &BeforeCvProjectProductionAI_Reset);CivRegisterAfter<CivHooks::CvProjectProductionAI_Reset>(host, &AfterCvProjectProductionAI_Reset);CivRegisterReplace<CivHooks::CvProjectProductionAI_Reset>(host, &ReplaceCvProjectProductionAI_Reset);

Code

25/// Clear out AI local variables26void CvProjectProductionAI::Reset()27{28	m_ProjectAIWeights.clear();2930	// Loop through reading each one and add an entry with 0 weight to our vector31	for(int i = 0; i < GC.GetGameProjects()->GetNumProjects(); i++)32	{33		m_ProjectAIWeights.push_back(i, 0);34	}35}

Calls

Called by