Bazaar developer reference

CvGrandStrategyAI::Write(FDataStream &)

Defined in
CvGrandStrategyAI.cpp, line 221
Class
CvGrandStrategyAI
Hook name
CivHooks::CvGrandStrategyAI_Write

Hooks

static bool BeforeCvGrandStrategyAI_Write(CvGrandStrategyAI* self, FDataStream& kStream);static void AfterCvGrandStrategyAI_Write(CvGrandStrategyAI* self, FDataStream& kStream);static void ReplaceCvGrandStrategyAI_Write(void (*original)(CvGrandStrategyAI*, FDataStream&), CvGrandStrategyAI* self, FDataStream& kStream);CivRegisterBefore<CivHooks::CvGrandStrategyAI_Write>(host, &BeforeCvGrandStrategyAI_Write);CivRegisterAfter<CivHooks::CvGrandStrategyAI_Write>(host, &AfterCvGrandStrategyAI_Write);CivRegisterReplace<CivHooks::CvGrandStrategyAI_Write>(host, &ReplaceCvGrandStrategyAI_Write);

Code

220/// Serialization write221void CvGrandStrategyAI::Write(FDataStream& kStream)222{223	// Current version number224	uint uiVersion = 1;225	kStream << uiVersion;226	MOD_SERIALIZE_INIT_WRITE(kStream);227228	kStream << m_iNumTurnsSinceActiveSet;229	kStream << m_eActiveGrandStrategy;230231	FAssertMsg(GC.getNumAIGrandStrategyInfos() > 0, "Number of AIStrategies to serialize is expected to greater than 0");232	kStream << ArrayWrapper<int>(m_pAIGrandStrategies->GetNumAIGrandStrategies(), m_paiGrandStrategyPriority);233234	kStream << ArrayWrapper<int>(MAX_MAJOR_CIVS, m_eGuessOtherPlayerActiveGrandStrategy);235	kStream << ArrayWrapper<int>(MAX_MAJOR_CIVS, m_eGuessOtherPlayerActiveGrandStrategyConfidence);236}

Calls

Called by