Bazaar developer reference

CvGrandStrategyAI::SetActiveGrandStrategy(AIGrandStrategyTypes)

Defined in
CvGrandStrategyAI.cpp, line 809
Class
CvGrandStrategyAI
Hook name
CivHooks::CvGrandStrategyAI_SetActiveGrandStrategy

Hooks

static bool BeforeCvGrandStrategyAI_SetActiveGrandStrategy(CvGrandStrategyAI* self, AIGrandStrategyTypes eGrandStrategy);static void AfterCvGrandStrategyAI_SetActiveGrandStrategy(CvGrandStrategyAI* self, AIGrandStrategyTypes eGrandStrategy);static void ReplaceCvGrandStrategyAI_SetActiveGrandStrategy(void (*original)(CvGrandStrategyAI*, AIGrandStrategyTypes), CvGrandStrategyAI* self, AIGrandStrategyTypes eGrandStrategy);CivRegisterBefore<CivHooks::CvGrandStrategyAI_SetActiveGrandStrategy>(host, &BeforeCvGrandStrategyAI_SetActiveGrandStrategy);CivRegisterAfter<CivHooks::CvGrandStrategyAI_SetActiveGrandStrategy>(host, &AfterCvGrandStrategyAI_SetActiveGrandStrategy);CivRegisterReplace<CivHooks::CvGrandStrategyAI_SetActiveGrandStrategy>(host, &ReplaceCvGrandStrategyAI_SetActiveGrandStrategy);

Code

808/// Sets the Active Grand Strategy for this Player: how am I trying to win right now?809void CvGrandStrategyAI::SetActiveGrandStrategy(AIGrandStrategyTypes eGrandStrategy)810{811	if(eGrandStrategy != NO_AIGRANDSTRATEGY)812	{813		m_eActiveGrandStrategy = eGrandStrategy;814815		SetNumTurnsSinceActiveSet(0);816	}817}

Calls

Called by