CvGrandStrategyAI::Read(FDataStream &)
- Defined in
- CvGrandStrategyAI.cpp, line 187
- Class
- CvGrandStrategyAI
- Hook name
CivHooks::CvGrandStrategyAI_Read
Hooks
static bool BeforeCvGrandStrategyAI_Read(CvGrandStrategyAI* self, FDataStream& kStream);static void AfterCvGrandStrategyAI_Read(CvGrandStrategyAI* self, FDataStream& kStream);static void ReplaceCvGrandStrategyAI_Read(void (*original)(CvGrandStrategyAI*, FDataStream&), CvGrandStrategyAI* self, FDataStream& kStream);CivRegisterBefore<CivHooks::CvGrandStrategyAI_Read>(host, &BeforeCvGrandStrategyAI_Read);CivRegisterAfter<CivHooks::CvGrandStrategyAI_Read>(host, &AfterCvGrandStrategyAI_Read);CivRegisterReplace<CivHooks::CvGrandStrategyAI_Read>(host, &ReplaceCvGrandStrategyAI_Read);
Code
186/// Serialization read187void CvGrandStrategyAI::Read(FDataStream& kStream)188{189 // Version number to maintain backwards compatibility190 uint uiVersion;191 kStream >> uiVersion;192 MOD_SERIALIZE_INIT_READ(kStream);193194 kStream >> m_iNumTurnsSinceActiveSet;195 kStream >> (int&)m_eActiveGrandStrategy;196197 FAssertMsg(m_pAIGrandStrategies != NULL && m_pAIGrandStrategies->GetNumAIGrandStrategies() > 0, "Number of AIGrandStrategies to serialize is expected to greater than 0");198#ifdef _MSC_VER199// JAR - if m_pAIGrandStrategies can be NULL at this point,200// the load will fail if the data isn't read. Better to crash201// here where the problem is than defer it.202#pragma warning ( push )203#pragma warning ( disable : 6011 )204#endif//_MSC_VER205 ArrayWrapper<int> wrapm_paiGrandStrategyPriority(m_pAIGrandStrategies->GetNumAIGrandStrategies(), m_paiGrandStrategyPriority);206#ifdef _MSC_VER207#pragma warning ( pop )208#endif//_MSC_VER209210 kStream >> wrapm_paiGrandStrategyPriority;211212 ArrayWrapper<int> wrapm_eGuessOtherPlayerActiveGrandStrategy(MAX_MAJOR_CIVS, m_eGuessOtherPlayerActiveGrandStrategy);213 kStream >> wrapm_eGuessOtherPlayerActiveGrandStrategy;214215 ArrayWrapper<int> wrapm_eGuessOtherPlayerActiveGrandStrategyConfidence(MAX_MAJOR_CIVS, m_eGuessOtherPlayerActiveGrandStrategyConfidence);216 kStream >> wrapm_eGuessOtherPlayerActiveGrandStrategyConfidence;217218}
Calls
ArrayWrapper::ArrayWrapper- CvAIGrandStrategyXMLEntries::GetNumAIGrandStrategies()
FDataStream::operator>>FDataStream::operator>>operator>>