Bazaar developer reference

CvDiplomacyAI::IsPlayerDoFwithAnyFriend(PlayerTypes) const

Defined in
CvDiplomacyAI.cpp, line 21372
Class
CvDiplomacyAI
Hook name
CivHooks::CvDiplomacyAI_IsPlayerDoFwithAnyFriend

Hooks

static bool BeforeCvDiplomacyAI_IsPlayerDoFwithAnyFriend(const CvDiplomacyAI* self, PlayerTypes ePlayer, bool& result);static void AfterCvDiplomacyAI_IsPlayerDoFwithAnyFriend(const CvDiplomacyAI* self, PlayerTypes ePlayer, bool& result);static bool ReplaceCvDiplomacyAI_IsPlayerDoFwithAnyFriend(bool (*original)(const CvDiplomacyAI*, PlayerTypes), const CvDiplomacyAI* self, PlayerTypes ePlayer);CivRegisterBefore<CivHooks::CvDiplomacyAI_IsPlayerDoFwithAnyFriend>(host, &BeforeCvDiplomacyAI_IsPlayerDoFwithAnyFriend);CivRegisterAfter<CivHooks::CvDiplomacyAI_IsPlayerDoFwithAnyFriend>(host, &AfterCvDiplomacyAI_IsPlayerDoFwithAnyFriend);CivRegisterReplace<CivHooks::CvDiplomacyAI_IsPlayerDoFwithAnyFriend>(host, &ReplaceCvDiplomacyAI_IsPlayerDoFwithAnyFriend);

Code

21371/// Does ePlayer have a DoF with anyone we have a DoF with?21372bool CvDiplomacyAI::IsPlayerDoFwithAnyFriend(PlayerTypes ePlayer) const21373{21374	PlayerTypes eLoopPlayer;21375	for(int iPlayerLoop = 0; iPlayerLoop < MAX_MAJOR_CIVS; iPlayerLoop++)21376	{21377		eLoopPlayer = (PlayerTypes) iPlayerLoop;2137821379		if(IsDoFAccepted(eLoopPlayer) && GET_PLAYER(ePlayer).GetDiplomacyAI()->IsDoFAccepted(eLoopPlayer))21380			return true;21381	}2138221383	return false;21384}

Calls

Called by