Bazaar developer reference

CvDiplomacyAI::GetGlobalCoopWarAcceptedState(PlayerTypes)

Defined in
CvDiplomacyAI.cpp, line 20631
Class
CvDiplomacyAI
Hook name
CivHooks::CvDiplomacyAI_GetGlobalCoopWarAcceptedState

Hooks

static bool BeforeCvDiplomacyAI_GetGlobalCoopWarAcceptedState(CvDiplomacyAI* self, PlayerTypes ePlayer, CoopWarStates& result);static void AfterCvDiplomacyAI_GetGlobalCoopWarAcceptedState(CvDiplomacyAI* self, PlayerTypes ePlayer, CoopWarStates& result);static CoopWarStates ReplaceCvDiplomacyAI_GetGlobalCoopWarAcceptedState(CoopWarStates (*original)(CvDiplomacyAI*, PlayerTypes), CvDiplomacyAI* self, PlayerTypes ePlayer);CivRegisterBefore<CivHooks::CvDiplomacyAI_GetGlobalCoopWarAcceptedState>(host, &BeforeCvDiplomacyAI_GetGlobalCoopWarAcceptedState);CivRegisterAfter<CivHooks::CvDiplomacyAI_GetGlobalCoopWarAcceptedState>(host, &AfterCvDiplomacyAI_GetGlobalCoopWarAcceptedState);CivRegisterReplace<CivHooks::CvDiplomacyAI_GetGlobalCoopWarAcceptedState>(host, &ReplaceCvDiplomacyAI_GetGlobalCoopWarAcceptedState);

Code

20630/// Check everyone we know to see if we're planning a coop war against them20631CoopWarStates CvDiplomacyAI::GetGlobalCoopWarAcceptedState(PlayerTypes ePlayer)20632{20633	CoopWarStates eBestState = NO_COOP_WAR_STATE;2063420635	PlayerTypes eLoopPlayer;20636	for(int iPlayerLoop = 0; iPlayerLoop < MAX_MAJOR_CIVS; iPlayerLoop++)20637	{20638		eLoopPlayer = (PlayerTypes) iPlayerLoop;2063920640		if(IsPlayerValid(eLoopPlayer))20641		{20642			if(GetCoopWarAcceptedState(eLoopPlayer, ePlayer) > eBestState)20643				eBestState = GetCoopWarAcceptedState(eLoopPlayer, ePlayer);20644		}20645	}2064620647	return eBestState;20648}

Calls

Called by