/// Serialization read void CvGrandStrategyAI::Read(FDataStream& kStream) { // Version number to maintain backwards compatibility uint uiVersion; kStream >> uiVersion; kStream >> m_iNumTurnsSinceActiveSet; kStream >> (int&)m_eActiveGrandStrategy; FAssertMsg(m_pAIGrandStrategies != NULL && m_pAIGrandStrategies->GetNumAIGrandStrategies() > 0, "Number of AIGrandStrategies to serialize is expected to greater than 0"); #ifdef _MSC_VER // JAR - if m_pAIGrandStrategies can be NULL at this point, // the load will fail if the data isn't read. Better to crash // here where the problem is than defer it. #pragma warning ( push ) #pragma warning ( disable : 6011 ) #endif//_MSC_VER ArrayWrapper<int> wrapm_paiGrandStrategyPriority(m_pAIGrandStrategies->GetNumAIGrandStrategies(), m_paiGrandStrategyPriority); #ifdef _MSC_VER #pragma warning ( pop ) #endif//_MSC_VER kStream >> wrapm_paiGrandStrategyPriority; ArrayWrapper<int> wrapm_eGuessOtherPlayerActiveGrandStrategy(MAX_MAJOR_CIVS, m_eGuessOtherPlayerActiveGrandStrategy); kStream >> wrapm_eGuessOtherPlayerActiveGrandStrategy; ArrayWrapper<int> wrapm_eGuessOtherPlayerActiveGrandStrategyConfidence(MAX_MAJOR_CIVS, m_eGuessOtherPlayerActiveGrandStrategyConfidence); kStream >> wrapm_eGuessOtherPlayerActiveGrandStrategyConfidence; }
/// Serialization read void CvGrandStrategyAI::Read(FDataStream& kStream) { // Version number to maintain backwards compatibility uint uiVersion; kStream >> uiVersion; // modVersion - v1, Snarko // We are using our own value here to keep backwards compatibility. // While we could use the Firaxis value that would cause issues when they update it, so we use our own for maximum backward compatibility. // Old firaxis patch and old mod version? No problem! Except if you weren't using our mod before... uint modVersion; kStream >> modVersion; // END modVersion kStream >> m_iNumTurnsSinceActiveSet; kStream >> (int&)m_eActiveGrandStrategy; FAssertMsg(m_pAIGrandStrategies != NULL && m_pAIGrandStrategies->GetNumAIGrandStrategies() > 0, "Number of AIGrandStrategies to serialize is expected to greater than 0"); #ifdef _MSC_VER // JAR - if m_pAIGrandStrategies can be NULL at this point, // the load will fail if the data isn't read. Better to crash // here where the problem is than defer it. #pragma warning ( push ) #pragma warning ( disable : 6011 ) #endif//_MSC_VER ArrayWrapper<int> wrapm_paiGrandStrategyPriority(m_pAIGrandStrategies->GetNumAIGrandStrategies(), m_paiGrandStrategyPriority); #ifdef _MSC_VER #pragma warning ( pop ) #endif//_MSC_VER kStream >> wrapm_paiGrandStrategyPriority; ArrayWrapper<int> wrapm_eGuessOtherPlayerActiveGrandStrategy(MAX_MAJOR_CIVS, m_eGuessOtherPlayerActiveGrandStrategy); kStream >> wrapm_eGuessOtherPlayerActiveGrandStrategy; ArrayWrapper<int> wrapm_eGuessOtherPlayerActiveGrandStrategyConfidence(MAX_MAJOR_CIVS, m_eGuessOtherPlayerActiveGrandStrategyConfidence); kStream >> wrapm_eGuessOtherPlayerActiveGrandStrategyConfidence; }