Bazaar developer reference

CvDiplomacyAI::GetPlayerNumTurnsAtWar(PlayerTypes) const

Defined in
CvDiplomacyAI.cpp, line 6512
Class
CvDiplomacyAI
Hook name
CivHooks::CvDiplomacyAI_GetPlayerNumTurnsAtWar

Hooks

static bool BeforeCvDiplomacyAI_GetPlayerNumTurnsAtWar(const CvDiplomacyAI* self, PlayerTypes ePlayer, int& result);static void AfterCvDiplomacyAI_GetPlayerNumTurnsAtWar(const CvDiplomacyAI* self, PlayerTypes ePlayer, int& result);static int ReplaceCvDiplomacyAI_GetPlayerNumTurnsAtWar(int (*original)(const CvDiplomacyAI*, PlayerTypes), const CvDiplomacyAI* self, PlayerTypes ePlayer);CivRegisterBefore<CivHooks::CvDiplomacyAI_GetPlayerNumTurnsAtWar>(host, &BeforeCvDiplomacyAI_GetPlayerNumTurnsAtWar);CivRegisterAfter<CivHooks::CvDiplomacyAI_GetPlayerNumTurnsAtWar>(host, &AfterCvDiplomacyAI_GetPlayerNumTurnsAtWar);CivRegisterReplace<CivHooks::CvDiplomacyAI_GetPlayerNumTurnsAtWar>(host, &ReplaceCvDiplomacyAI_GetPlayerNumTurnsAtWar);

Code

6511/// How many turns have we been at war with this Player?6512int CvDiplomacyAI::GetPlayerNumTurnsAtWar(PlayerTypes ePlayer) const6513{6514	CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index.  Please send Jon this with your last 5 autosaves and what changelist # you're playing.");6515	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.");6516	return m_paiPlayerNumTurnsAtWar[ePlayer];6517}

Called by