Bazaar developer reference

CvHomelandAI::PlotWriterMoves()

Defined in
CvHomelandAI.cpp, line 1769
Class
CvHomelandAI
Hook name
CivHooks::CvHomelandAI_PlotWriterMoves

Hooks

static bool BeforeCvHomelandAI_PlotWriterMoves(CvHomelandAI* self);static void AfterCvHomelandAI_PlotWriterMoves(CvHomelandAI* self);static void ReplaceCvHomelandAI_PlotWriterMoves(void (*original)(CvHomelandAI*), CvHomelandAI* self);CivRegisterBefore<CivHooks::CvHomelandAI_PlotWriterMoves>(host, &BeforeCvHomelandAI_PlotWriterMoves);CivRegisterAfter<CivHooks::CvHomelandAI_PlotWriterMoves>(host, &AfterCvHomelandAI_PlotWriterMoves);CivRegisterReplace<CivHooks::CvHomelandAI_PlotWriterMoves>(host, &ReplaceCvHomelandAI_PlotWriterMoves);

Code

1768/// Find moves for great writers1769void CvHomelandAI::PlotWriterMoves()1770{1771	ClearCurrentMoveUnits();17721773	// Loop through all recruited units1774	for(list<int>::iterator it = m_CurrentTurnUnits.begin(); it != m_CurrentTurnUnits.end(); ++it)1775	{1776		UnitHandle pUnit = m_pPlayer->getUnit(*it);1777		if(pUnit)1778		{1779			if (pUnit->AI_getUnitAIType() == UNITAI_WRITER)1780			{1781				CvHomelandUnit unit;1782				unit.SetID(pUnit->GetID());1783				m_CurrentMoveUnits.push_back(unit);1784			}1785		}1786	}17871788	if(m_CurrentMoveUnits.size() > 0)1789	{1790		ExecuteWriterMoves();1791	}1792}

Calls

Called by