Bazaar developer reference

CvHomelandAI::PlotAdmiralMoves()

Defined in
CvHomelandAI.cpp, line 2107
Class
CvHomelandAI
Hook name
CivHooks::CvHomelandAI_PlotAdmiralMoves

Hooks

static bool BeforeCvHomelandAI_PlotAdmiralMoves(CvHomelandAI* self);static void AfterCvHomelandAI_PlotAdmiralMoves(CvHomelandAI* self);static void ReplaceCvHomelandAI_PlotAdmiralMoves(void (*original)(CvHomelandAI*), CvHomelandAI* self);CivRegisterBefore<CivHooks::CvHomelandAI_PlotAdmiralMoves>(host, &BeforeCvHomelandAI_PlotAdmiralMoves);CivRegisterAfter<CivHooks::CvHomelandAI_PlotAdmiralMoves>(host, &AfterCvHomelandAI_PlotAdmiralMoves);CivRegisterReplace<CivHooks::CvHomelandAI_PlotAdmiralMoves>(host, &ReplaceCvHomelandAI_PlotAdmiralMoves);

Code

2106/// Find moves for great admirals2107void CvHomelandAI::PlotAdmiralMoves()2108{2109	ClearCurrentMoveUnits();21102111	// Loop through all recruited units2112	for(list<int>::iterator it = m_CurrentTurnUnits.begin(); it != m_CurrentTurnUnits.end(); ++it)2113	{2114		UnitHandle pUnit = m_pPlayer->getUnit(*it);2115		if(pUnit)2116		{2117			if(pUnit->AI_getUnitAIType() == UNITAI_ADMIRAL)2118			{2119				CvHomelandUnit unit;2120				unit.SetID(pUnit->GetID());2121				m_CurrentMoveUnits.push_back(unit);2122			}2123		}2124	}21252126	if(m_CurrentMoveUnits.size() > 0)2127	{2128		ExecuteAdmiralMoves();2129	}2130}

Calls

Called by