Bazaar developer reference

CvHomelandAI::PlotEngineerMoves()

Defined in
CvHomelandAI.cpp, line 1873
Class
CvHomelandAI
Hook name
CivHooks::CvHomelandAI_PlotEngineerMoves

Hooks

static bool BeforeCvHomelandAI_PlotEngineerMoves(CvHomelandAI* self);static void AfterCvHomelandAI_PlotEngineerMoves(CvHomelandAI* self);static void ReplaceCvHomelandAI_PlotEngineerMoves(void (*original)(CvHomelandAI*), CvHomelandAI* self);CivRegisterBefore<CivHooks::CvHomelandAI_PlotEngineerMoves>(host, &BeforeCvHomelandAI_PlotEngineerMoves);CivRegisterAfter<CivHooks::CvHomelandAI_PlotEngineerMoves>(host, &AfterCvHomelandAI_PlotEngineerMoves);CivRegisterReplace<CivHooks::CvHomelandAI_PlotEngineerMoves>(host, &ReplaceCvHomelandAI_PlotEngineerMoves);

Code

1872/// Find moves for great engineers1873void CvHomelandAI::PlotEngineerMoves()1874{1875	ClearCurrentMoveUnits();18761877	// Loop through all recruited units1878	for(list<int>::iterator it = m_CurrentTurnUnits.begin(); it != m_CurrentTurnUnits.end(); ++it)1879	{1880		UnitHandle pUnit = m_pPlayer->getUnit(*it);1881		if(pUnit)1882		{1883			if(pUnit->AI_getUnitAIType() == UNITAI_ENGINEER)1884			{1885				CvHomelandUnit unit;1886				unit.SetID(pUnit->GetID());1887				m_CurrentMoveUnits.push_back(unit);1888			}1889		}1890	}18911892	if(m_CurrentMoveUnits.size() > 0)1893	{1894		ExecuteEngineerMoves();1895	}1896}

Calls

Called by