Bazaar developer reference

CvDiplomacyAI::IsPlayerDoFwithAnyEnemy(PlayerTypes) const

Defined in
CvDiplomacyAI.cpp, line 21387
Class
CvDiplomacyAI
Hook name
CivHooks::CvDiplomacyAI_IsPlayerDoFwithAnyEnemy

Hooks

static bool BeforeCvDiplomacyAI_IsPlayerDoFwithAnyEnemy(const CvDiplomacyAI* self, PlayerTypes ePlayer, bool& result);static void AfterCvDiplomacyAI_IsPlayerDoFwithAnyEnemy(const CvDiplomacyAI* self, PlayerTypes ePlayer, bool& result);static bool ReplaceCvDiplomacyAI_IsPlayerDoFwithAnyEnemy(bool (*original)(const CvDiplomacyAI*, PlayerTypes), const CvDiplomacyAI* self, PlayerTypes ePlayer);CivRegisterBefore<CivHooks::CvDiplomacyAI_IsPlayerDoFwithAnyEnemy>(host, &BeforeCvDiplomacyAI_IsPlayerDoFwithAnyEnemy);CivRegisterAfter<CivHooks::CvDiplomacyAI_IsPlayerDoFwithAnyEnemy>(host, &AfterCvDiplomacyAI_IsPlayerDoFwithAnyEnemy);CivRegisterReplace<CivHooks::CvDiplomacyAI_IsPlayerDoFwithAnyEnemy>(host, &ReplaceCvDiplomacyAI_IsPlayerDoFwithAnyEnemy);

Code

21386/// Does ePlayer have a DoF with anyone we have denounced?21387bool CvDiplomacyAI::IsPlayerDoFwithAnyEnemy(PlayerTypes ePlayer) const21388{21389	PlayerTypes eLoopPlayer;21390	for(int iPlayerLoop = 0; iPlayerLoop < MAX_MAJOR_CIVS; iPlayerLoop++)21391	{21392		eLoopPlayer = (PlayerTypes) iPlayerLoop;2139321394		if(IsDenouncedPlayer(eLoopPlayer) && GET_PLAYER(ePlayer).GetDiplomacyAI()->IsDoFAccepted(eLoopPlayer))21395			return true;21396	}2139721398	return false;21399}

Calls

Called by