Bazaar developer reference

CvPlayerEspionage::HasEstablishedSurveillance(uint)

Defined in
CvEspionageClasses.cpp, line 1900
Class
CvPlayerEspionage
Hook name
CivHooks::CvPlayerEspionage_HasEstablishedSurveillance

Hooks

static bool BeforeCvPlayerEspionage_HasEstablishedSurveillance(CvPlayerEspionage* self, uint uiSpyIndex, bool& result);static void AfterCvPlayerEspionage_HasEstablishedSurveillance(CvPlayerEspionage* self, uint uiSpyIndex, bool& result);static bool ReplaceCvPlayerEspionage_HasEstablishedSurveillance(bool (*original)(CvPlayerEspionage*, uint), CvPlayerEspionage* self, uint uiSpyIndex);CivRegisterBefore<CivHooks::CvPlayerEspionage_HasEstablishedSurveillance>(host, &BeforeCvPlayerEspionage_HasEstablishedSurveillance);CivRegisterAfter<CivHooks::CvPlayerEspionage_HasEstablishedSurveillance>(host, &AfterCvPlayerEspionage_HasEstablishedSurveillance);CivRegisterReplace<CivHooks::CvPlayerEspionage_HasEstablishedSurveillance>(host, &ReplaceCvPlayerEspionage_HasEstablishedSurveillance);

Code

1899/// HasEstablishedSurveillance - Has the spy established surveillance in their city1900bool CvPlayerEspionage::HasEstablishedSurveillance(uint uiSpyIndex)1901{1902	CvAssertMsg(uiSpyIndex < m_aSpyList.size(), "iSpyIndex is out of bounds");1903	if(uiSpyIndex >= m_aSpyList.size())1904	{1905		return false;1906	}19071908	if(!IsSpyInCity(uiSpyIndex))1909	{1910		return false;1911	}19121913	CvCity* pCity = GetCityWithSpy(uiSpyIndex);1914	if(pCity == NULL)1915		return false;19161917	CvCityEspionage* pCityEspionage = pCity->GetCityEspionage();1918	if(m_aSpyList[uiSpyIndex].m_eSpyState == SPY_STATE_SURVEILLANCE && pCityEspionage->HasReachedGoal(m_pPlayer->GetID()))1919	{1920		return true;1921	}1922	else if(m_aSpyList[uiSpyIndex].m_eSpyState == SPY_STATE_GATHERING_INTEL || m_aSpyList[uiSpyIndex].m_eSpyState == SPY_STATE_RIG_ELECTION || m_aSpyList[uiSpyIndex].m_eSpyState == SPY_STATE_SCHMOOZE)1923	{1924		return true;1925	}19261927	return false;1928}

Calls

Called by