Bazaar developer reference

CvWonderProductionAI::Reset()

Defined in
CvWonderProductionAI.cpp, line 48
Class
CvWonderProductionAI
Hook name
CivHooks::CvWonderProductionAI_Reset

Hooks

static bool BeforeCvWonderProductionAI_Reset(CvWonderProductionAI* self);static void AfterCvWonderProductionAI_Reset(CvWonderProductionAI* self);static void ReplaceCvWonderProductionAI_Reset(void (*original)(CvWonderProductionAI*), CvWonderProductionAI* self);CivRegisterBefore<CivHooks::CvWonderProductionAI_Reset>(host, &BeforeCvWonderProductionAI_Reset);CivRegisterAfter<CivHooks::CvWonderProductionAI_Reset>(host, &AfterCvWonderProductionAI_Reset);CivRegisterReplace<CivHooks::CvWonderProductionAI_Reset>(host, &ReplaceCvWonderProductionAI_Reset);

Code

47/// Clear out AI local variables48void CvWonderProductionAI::Reset()49{50	CvAssertMsg(m_pBuildings != NULL, "Wonder Production AI init failure: building entries are NULL");5152	// Reset vector53	m_WonderAIWeights.clear();5455	// Loop through reading each one and adding it to our vector56	if(m_pBuildings)57	{58		for(int i = 0; i < m_pBuildings->GetNumBuildings(); i++)59		{60			m_WonderAIWeights.push_back(i, 0);61		}62	}63}

Calls

Called by