Bazaar developer reference

CvAIOperation::Init(int, PlayerTypes, PlayerTypes, int, CvCity *, CvCity *)

Defined in
CvAIOperation.cpp, line 47
Class
CvAIOperation
Hook name
CivHooks::CvAIOperation_Init
Overridden by
CvAIEnemyTerritoryOperation::Init(int, PlayerTypes, PlayerTypes, int, CvCity *, CvCity *), CvAIEscortedOperation::Init(int, PlayerTypes, PlayerTypes, int, CvCity *, CvCity *), CvAINavalEscortedOperation::Init(int, PlayerTypes, PlayerTypes, int, CvCity *, CvCity *), CvAIOperationCityCloseDefense::Init(int, PlayerTypes, PlayerTypes, int, CvCity *, CvCity *), CvAIOperationNukeAttack::Init(int, PlayerTypes, PlayerTypes, int, CvCity *, CvCity *), CvAIOperationRapidResponse::Init(int, PlayerTypes, PlayerTypes, int, CvCity *, CvCity *)

Hooks

static bool BeforeCvAIOperation_Init(CvAIOperation* self, int iID, PlayerTypes eOwner, PlayerTypes eEnemy, int iDefaultArea, CvCity* arg4, CvCity* pMuster);static void AfterCvAIOperation_Init(CvAIOperation* self, int iID, PlayerTypes eOwner, PlayerTypes eEnemy, int iDefaultArea, CvCity* arg4, CvCity* pMuster);static void ReplaceCvAIOperation_Init(void (*original)(CvAIOperation*, int, PlayerTypes, PlayerTypes, int, CvCity*, CvCity*), CvAIOperation* self, int iID, PlayerTypes eOwner, PlayerTypes eEnemy, int iDefaultArea, CvCity* arg4, CvCity* pMuster);CivRegisterBefore<CivHooks::CvAIOperation_Init>(host, &BeforeCvAIOperation_Init);CivRegisterAfter<CivHooks::CvAIOperation_Init>(host, &AfterCvAIOperation_Init);CivRegisterReplace<CivHooks::CvAIOperation_Init>(host, &ReplaceCvAIOperation_Init);

Code

46/// Initialize47void CvAIOperation::Init(int iID, PlayerTypes eOwner, PlayerTypes eEnemy, int iDefaultArea, CvCity* /*pTarget*/, CvCity* pMuster)48{49	Uninit();50	m_iID = iID;51	m_eOwner = eOwner;52	m_eEnemy = eEnemy;53	m_iDefaultArea = iDefaultArea;54	m_bShouldReplaceLossesWithReinforcements = false;5556	SetStartCityPlot(pMuster->plot());5758	// create the armies that are needed and set the state to ARMYAISTATE_WAITING_FOR_UNITS_TO_REINFORCE59	BuildListOfUnitsWeStillNeedToBuild();60	GrabUnitsFromTheReserves(NULL, NULL);61}

Calls

Called by