Bazaar developer reference

CvDiplomacyAI::GetNumWarsFought(PlayerTypes) const

Defined in
CvDiplomacyAI.cpp, line 6539
Class
CvDiplomacyAI
Hook name
CivHooks::CvDiplomacyAI_GetNumWarsFought

Hooks

static bool BeforeCvDiplomacyAI_GetNumWarsFought(const CvDiplomacyAI* self, PlayerTypes ePlayer, int& result);static void AfterCvDiplomacyAI_GetNumWarsFought(const CvDiplomacyAI* self, PlayerTypes ePlayer, int& result);static int ReplaceCvDiplomacyAI_GetNumWarsFought(int (*original)(const CvDiplomacyAI*, PlayerTypes), const CvDiplomacyAI* self, PlayerTypes ePlayer);CivRegisterBefore<CivHooks::CvDiplomacyAI_GetNumWarsFought>(host, &BeforeCvDiplomacyAI_GetNumWarsFought);CivRegisterAfter<CivHooks::CvDiplomacyAI_GetNumWarsFought>(host, &AfterCvDiplomacyAI_GetNumWarsFought);CivRegisterReplace<CivHooks::CvDiplomacyAI_GetNumWarsFought>(host, &ReplaceCvDiplomacyAI_GetNumWarsFought);

Code

6538/// How many times have we gone to war?6539int CvDiplomacyAI::GetNumWarsFought(PlayerTypes ePlayer) const6540{6541	CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index.  Please send Jon this with your last 5 autosaves and what changelist # you're playing.");6542	CvAssertMsg(ePlayer < MAX_CIV_PLAYERS, "DIPLOMACY_AI: Invalid Player Index.  Please send Jon this with your last 5 autosaves and what changelist # you're playing.");6543	return m_paiNumWarsFought[ePlayer];6544}

Called by