Bazaar developer reference

CvGrandStrategyAI::GetBaseGrandStrategyPriority(AIGrandStrategyTypes)

Defined in
CvGrandStrategyAI.cpp, line 761
Class
CvGrandStrategyAI
Hook name
CivHooks::CvGrandStrategyAI_GetBaseGrandStrategyPriority

Hooks

static bool BeforeCvGrandStrategyAI_GetBaseGrandStrategyPriority(CvGrandStrategyAI* self, AIGrandStrategyTypes eGrandStrategy, int& result);static void AfterCvGrandStrategyAI_GetBaseGrandStrategyPriority(CvGrandStrategyAI* self, AIGrandStrategyTypes eGrandStrategy, int& result);static int ReplaceCvGrandStrategyAI_GetBaseGrandStrategyPriority(int (*original)(CvGrandStrategyAI*, AIGrandStrategyTypes), CvGrandStrategyAI* self, AIGrandStrategyTypes eGrandStrategy);CivRegisterBefore<CivHooks::CvGrandStrategyAI_GetBaseGrandStrategyPriority>(host, &BeforeCvGrandStrategyAI_GetBaseGrandStrategyPriority);CivRegisterAfter<CivHooks::CvGrandStrategyAI_GetBaseGrandStrategyPriority>(host, &AfterCvGrandStrategyAI_GetBaseGrandStrategyPriority);CivRegisterReplace<CivHooks::CvGrandStrategyAI_GetBaseGrandStrategyPriority>(host, &ReplaceCvGrandStrategyAI_GetBaseGrandStrategyPriority);

Code

760/// Get the base Priority for a Grand Strategy; these are elements common to ALL Grand Strategies761int CvGrandStrategyAI::GetBaseGrandStrategyPriority(AIGrandStrategyTypes eGrandStrategy)762{763	CvAIGrandStrategyXMLEntry* pGrandStrategy = GetAIGrandStrategies()->GetEntry(eGrandStrategy);764765	int iPriority = 0;766767	// Personality effect on Priority768	for(int iFlavorLoop = 0; iFlavorLoop < GC.getNumFlavorTypes(); iFlavorLoop++)769	{770		if(pGrandStrategy->GetFlavorValue(iFlavorLoop) != 0)771		{772			iPriority += (pGrandStrategy->GetFlavorValue(iFlavorLoop) * GetPlayer()->GetFlavorManager()->GetPersonalityIndividualFlavor((FlavorTypes) iFlavorLoop));773		}774	}775776	return iPriority;777}

Calls

Called by