Bazaar developer reference

operator<<(FDataStream &, const CvGameDeals &)

Defined in
CvDealClasses.cpp, line 4240
Hook name
CivHooks::op_shl_with_FDataStream_const_CvGameDeals

Hooks

static bool Beforeop_shl_with_FDataStream_const_CvGameDeals(FDataStream& saveTo, const CvGameDeals& readFrom, FDataStream*& result);static void Afterop_shl_with_FDataStream_const_CvGameDeals(FDataStream& saveTo, const CvGameDeals& readFrom, FDataStream*& result);static FDataStream& Replaceop_shl_with_FDataStream_const_CvGameDeals(FDataStream& (*original)(FDataStream&, const CvGameDeals&), FDataStream& saveTo, const CvGameDeals& readFrom);CivRegisterBefore<CivHooks::op_shl_with_FDataStream_const_CvGameDeals>(host, &Beforeop_shl_with_FDataStream_const_CvGameDeals);CivRegisterAfter<CivHooks::op_shl_with_FDataStream_const_CvGameDeals>(host, &Afterop_shl_with_FDataStream_const_CvGameDeals);CivRegisterReplace<CivHooks::op_shl_with_FDataStream_const_CvGameDeals>(host, &Replaceop_shl_with_FDataStream_const_CvGameDeals);

Code

4239/// Serialization write4240FDataStream& operator<<(FDataStream& saveTo, const CvGameDeals& readFrom)4241{4242	uint uiVersion = 1;4243	DealList::const_iterator it;4244	saveTo << uiVersion;4245	MOD_SERIALIZE_INIT_WRITE(saveTo);42464247#if defined(MOD_AI_MP_DIPLOMACY)4248	if (MOD_AI_MP_DIPLOMACY) {4249		// JdH => savegame compatible save4250		DealList saveList;4251		for (it = readFrom.m_ProposedDeals.begin(); it != readFrom.m_ProposedDeals.end(); ++it)4252		{4253			if (CvPreGame::isHuman(it->GetFromPlayer()) && CvPreGame::isHuman(it->GetToPlayer()))4254			{4255				// only save human to human deals until we save notifications & requests too4256				saveList.push_back(*it);4257			}4258		}4259		saveTo << saveList.size();4260		for (it = saveList.begin(); it != saveList.end(); ++it) 4261		{4262			saveTo << *it;4263		}4264	} else {4265#endif4266	saveTo << readFrom.m_ProposedDeals.size();4267	for(it = readFrom.m_ProposedDeals.begin(); it != readFrom.m_ProposedDeals.end(); ++it)4268	{4269		saveTo << *it;4270	}4271#if defined(MOD_AI_MP_DIPLOMACY)4272	}4273#endif4274	saveTo << readFrom.m_CurrentDeals.size();4275	for(it = readFrom.m_CurrentDeals.begin(); it != readFrom.m_CurrentDeals.end(); ++it)4276	{4277		saveTo << *it;4278	}4279	saveTo << readFrom.m_HistoricalDeals.size();4280	for(it = readFrom.m_HistoricalDeals.begin(); it != readFrom.m_HistoricalDeals.end(); ++it)4281	{4282		saveTo << *it;4283	}42844285	return saveTo;4286}

Calls