Bazaar developer reference

CvDiplomacyAI::GetNumDoF()

Defined in
CvDiplomacyAI.cpp, line 21300
Class
CvDiplomacyAI
Hook name
CivHooks::CvDiplomacyAI_GetNumDoF

Hooks

static bool BeforeCvDiplomacyAI_GetNumDoF(CvDiplomacyAI* self, int& result);static void AfterCvDiplomacyAI_GetNumDoF(CvDiplomacyAI* self, int& result);static int ReplaceCvDiplomacyAI_GetNumDoF(int (*original)(CvDiplomacyAI*), CvDiplomacyAI* self);CivRegisterBefore<CivHooks::CvDiplomacyAI_GetNumDoF>(host, &BeforeCvDiplomacyAI_GetNumDoF);CivRegisterAfter<CivHooks::CvDiplomacyAI_GetNumDoF>(host, &AfterCvDiplomacyAI_GetNumDoF);CivRegisterReplace<CivHooks::CvDiplomacyAI_GetNumDoF>(host, &ReplaceCvDiplomacyAI_GetNumDoF);

Code

21300int CvDiplomacyAI::GetNumDoF()21301{21302	int iRtnValue = 0;2130321304	PlayerTypes eLoopPlayer;21305	for(int iPlayerLoop = 0; iPlayerLoop < MAX_MAJOR_CIVS; iPlayerLoop++)21306	{21307		eLoopPlayer = (PlayerTypes) iPlayerLoop;2130821309		if(IsPlayerValid(eLoopPlayer))21310		{21311			if(IsDoFAccepted(eLoopPlayer))21312			{21313				iRtnValue++;21314			}21315		}21316	}2131721318	return iRtnValue;21319}

Calls

Called by